]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libsmartcols: fix empty cell padding
authorKarel Zak <kzak@redhat.com>
Tue, 6 Sep 2016 09:02:59 +0000 (11:02 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 6 Sep 2016 09:02:59 +0000 (11:02 +0200)
The code does not print columns separator.

Signed-off-by: Karel Zak <kzak@redhat.com>
libsmartcols/src/table_print.c

index ba5eeccacc556b546fb3ff2bb2c29a2a90f7e302..8981f821c474055d9c987e9e71ff40253041e63f 100644 (file)
@@ -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);
 }