summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-03-03 21:01:18 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-03-03 21:01:18 +0000
commit1b8705bd44d05c7b6a08d70a54941e78fbabd58a (patch)
tree9cc0ac665335aa6b398caeb99620c08e25955331 /src
parentbc0069c02f0c10a6f94f2718282ee6bc84864c1d (diff)
downloadirssi-1b8705bd44d05c7b6a08d70a54941e78fbabd58a.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/core/misc.c3
1 files changed, 2 insertions, 1 deletions
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;