From: Karel Zak Date: Mon, 23 Oct 2023 13:20:47 +0000 (+0200) Subject: libsmartcols: fix uninitialized local variable in sample X-Git-Tag: v2.40-rc1~180 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=24947d367e81a8a1ecfe17232230eae2b19616db;p=thirdparty%2Futil-linux.git libsmartcols: fix uninitialized local variable in sample Signed-off-by: Karel Zak --- 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)