summaryrefslogtreecommitdiffstats
path: root/src/day.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/day.c')
-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)