From bc2bead505eba9dc95ddadbcf465422927d787b5 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 28 Jun 2011 16:17:41 +0200 Subject: Do not try to display items with negative width Don't display anything rather than segfault if the appointment panel becomes too small (e.g. during a terminal resize). Signed-off-by: Lukas Fleischer --- src/day.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/day.c b/src/day.c index 10ecc33..4c73f43 100644 --- a/src/day.c +++ b/src/day.c @@ -354,6 +354,9 @@ display_item (int incolor, char *msg, int recur, int note, int len, int y, int ch_recur, ch_note; char buf[len]; + if (len <= 0) + return; + win = apad.ptrwin; ch_recur = (recur) ? '*' : ' '; ch_note = (note) ? '>' : ' '; -- cgit v1.2.3-70-g09d2