From: Igor Gnatenko Date: Thu, 21 Jan 2016 16:25:15 +0000 (+0100) Subject: libsmartcols: don't try to align title if it's more that term X-Git-Tag: v2.28-rc1~174^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=284ee2a9a4d2fef60dc1e21d3b1628bf45eea04f;p=thirdparty%2Futil-linux.git libsmartcols: don't try to align title if it's more that term Signed-off-by: Igor Gnatenko --- diff --git a/libsmartcols/src/table_print.c b/libsmartcols/src/table_print.c index a0fc68a99f..6bb2753dc0 100644 --- a/libsmartcols/src/table_print.c +++ b/libsmartcols/src/table_print.c @@ -557,6 +557,9 @@ static void print_title(struct libscols_table *tb) len = strlen(tb->title); + if (len > tb->termwidth) + len = tb->termwidth; + DBG(TAB, ul_debugobj(tb, "printing title")); if (tb->title_color)