From 1b8705bd44d05c7b6a08d70a54941e78fbabd58a Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 3 Mar 2001 21:01:18 +0000 Subject: [PATCH] Make sure there's always at least one column even if there's items wider than max. width allows. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1320 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/misc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/misc.c b/src/core/misc.c index f32151a5..ebbd34cd 100644 --- a/src/core/misc.c +++ b/src/core/misc.c @@ -638,6 +638,7 @@ int get_max_column_count(GSList *items, COLUMN_LEN_FUNC len_func, } len = max_width/(item_extra+item_min_size); + if (len <= 0) len = 1; if (max_columns <= 0 || len < max_columns) max_columns = len; @@ -670,7 +671,7 @@ int get_max_column_count(GSList *items, COLUMN_LEN_FUNC len_func, item_pos++; } - for (n = max_columns-1; n > 0; n--) { + for (n = max_columns-1; n > 1; n--) { if (columns_width[n] <= max_width && columns[n][n] > 0) break;