From 24947d367e81a8a1ecfe17232230eae2b19616db Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 23 Oct 2023 15:20:47 +0200 Subject: [PATCH] libsmartcols: fix uninitialized local variable in sample Signed-off-by: Karel Zak --- libsmartcols/samples/fromfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsmartcols/samples/fromfile.c b/libsmartcols/samples/fromfile.c index a921b20a92..631262f841 100644 --- a/libsmartcols/samples/fromfile.c +++ b/libsmartcols/samples/fromfile.c @@ -141,7 +141,7 @@ static int parse_column_data(FILE *f, struct libscols_table *tb, int col) while ((i = getline(&str, &len, f)) != -1) { struct libscols_line *ln; - int rc; + int rc = 0; ln = scols_table_get_line(tb, nlines++); if (!ln) @@ -162,7 +162,7 @@ static int parse_column_data(FILE *f, struct libscols_table *tb, int col) len = unhexmangle_to_buffer(str, buf, len); if (len) - scols_cell_refer_memory(ce, buf, len); + rc = scols_cell_refer_memory(ce, buf, len); } else rc = scols_line_set_data(ln, col, str); if (rc) -- 2.47.3