libsmartcols: don't use fprintf() when count cells

fprintf("%*s") is based on bytes, no cells.

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2015-12-07 12:22:29 +01:00
parent df73852b6e
commit 05c1123bc3
1 changed files with 3 additions and 1 deletions

View File

@ -343,7 +343,9 @@ static int print_data(struct libscols_table *tb,
size_t xw = cl->width;
if (color)
fputs(color, tb->out);
fprintf(tb->out, "%*s", (int) xw, data);
for (i = len; i < width; i++)
fputc(' ', tb->out);
fputs(data, tb->out);
if (color)
fputs(UL_COLOR_RESET, tb->out);
if (len < xw)