From 61a8670baadfde3c694c14391c013057fd11fd1e Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 6 Sep 2016 11:02:59 +0200 Subject: [PATCH] libsmartcols: fix empty cell padding The code does not print columns separator. Signed-off-by: Karel Zak --- libsmartcols/src/table_print.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsmartcols/src/table_print.c b/libsmartcols/src/table_print.c index ba5eeccacc..8981f821c4 100644 --- a/libsmartcols/src/table_print.c +++ b/libsmartcols/src/table_print.c @@ -244,8 +244,11 @@ static void print_empty_cell(struct libscols_table *tb, } } /* fill rest of cell with space */ - for(; len_pad <= cl->width; ++len_pad) + for(; len_pad < cl->width; ++len_pad) fputc(' ', tb->out); + + if (!is_last_column(cl)) + fputs(colsep(tb), tb->out); } -- 2.47.2