From 2dc0c6283b41a8331de13092c7287a3cb7160a0a Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 18 Apr 2014 12:01:59 +0200 Subject: [PATCH] libsmartcols: fix buffer usage Signed-off-by: Karel Zak --- libsmartcols/src/table_print.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.47.3