From: Karel Zak Date: Fri, 18 Apr 2014 10:01:59 +0000 (+0200) Subject: libsmartcols: fix buffer usage X-Git-Tag: v2.25-rc1~266 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2dc0c6283b41a8331de13092c7287a3cb7160a0a;p=thirdparty%2Futil-linux.git libsmartcols: fix buffer usage Signed-off-by: Karel Zak --- diff --git a/libsmartcols/src/table_print.c b/libsmartcols/src/table_print.c index c3dcfaefde..29420537e5 100644 --- a/libsmartcols/src/table_print.c +++ b/libsmartcols/src/table_print.c @@ -297,6 +297,8 @@ static int cell_to_buffer(struct libscols_table *tb, assert(buf); assert(cl->seqnum <= tb->ncols); + buffer_reset_data(buf); + ce = scols_line_get_cell(ln, cl->seqnum); data = ce ? scols_cell_get_data(ce) : NULL; if (!data) @@ -308,8 +310,6 @@ static int cell_to_buffer(struct libscols_table *tb, /* * Tree stuff */ - buffer_reset_data(buf); - if (ln->parent) { rc = line_ascii_art_to_buffer(tb, ln->parent, buf);