diff options
author | Sascha Hauer <sha@pengutronix.de> | 2009-10-13 16:47:35 +0200 |
---|---|---|
committer | Sascha Hauer <sha@pengutronix.de> | 2009-10-15 16:06:05 +0200 |
commit | 51b0b001d3146951bcf8b00922453fa02b867105 (patch) | |
tree | ce2abb3ff97c76ad93992f073197c13c1b0d79b9 /lib | |
parent | 146f9b6e5b90380db3407a88518193ef78bbe72e (diff) | |
download | barebox-51b0b001d3146951bcf8b00922453fa02b867105.tar.gz barebox-51b0b001d3146951bcf8b00922453fa02b867105.tar.xz |
stringlist: Fix printing on smaller consoles
Do not add additional space between strings, we already
did this by adding 4 to the string length.
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/stringlist.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/stringlist.c b/lib/stringlist.c index bc3f7e7721..9ccf8fa836 100644 --- a/lib/stringlist.c +++ b/lib/stringlist.c @@ -30,15 +30,16 @@ void string_list_print_by_column(struct string_list *sl) if (!len) return; - num = 80 / len; + num = 80 / (len + 1); if (len == 0) len = 1; i = 0; list_for_each_entry(entry, &sl->list, list) { - printf("%-*s ", len, entry->str); if (!(++i % num)) - printf("\n"); + printf("%s\n", entry->str); + else + printf("%-*s", len, entry->str); } if (i % num) printf("\n"); |