summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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;