aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2019-05-30 09:42:21 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2019-05-30 07:46:33 -0400
commite6ff3f417c1e89b6e2530e6afe3802217482d052 (patch)
tree50a24d1521f159719034447e293220fbfdfcc431
parent0edc2e86378fdfe00255be3ac30c56eff359c961 (diff)
downloadcalcurse-e6ff3f417c1e89b6e2530e6afe3802217482d052.tar.gz
calcurse-e6ff3f417c1e89b6e2530e6afe3802217482d052.zip
Return at least two days in multiple days mode
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r--src/day.c5
1 files changed, 4 insertions, 1 deletions
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)