From 284ee2a9a4d2fef60dc1e21d3b1628bf45eea04f Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Thu, 21 Jan 2016 17:25:15 +0100 Subject: [PATCH] libsmartcols: don't try to align title if it's more that term Signed-off-by: Igor Gnatenko --- libsmartcols/src/table_print.c | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.47.2