From e6ff3f417c1e89b6e2530e6afe3802217482d052 Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Thu, 30 May 2019 09:42:21 +0200 Subject: Return at least two days in multiple days mode Signed-off-by: Lars Henriksen Signed-off-by: Lukas Fleischer --- src/day.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/day.c b/src/day.c index 5bbc0a4..95b61b5 100644 --- a/src/day.c +++ b/src/day.c @@ -120,8 +120,11 @@ int day_get_days(void) /* Assume one event per day (no event separator). */ day = 2 + conf.header_line + conf.day_separator + conf.empty_appt_line; + if (panel <= day) + return 2; + /* Round up. */ - return panel / day + (panel % day != 0); + return panel / day + (panel % day ? 1 : 0); } static void day_free(struct day_item *day) -- cgit v1.2.3-70-g09d2