aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-11-24 23:55:28 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2012-11-25 18:30:10 +0100
commitedf3903ac840b1889b9bdd687965453a7e26b7ee (patch)
tree38dbf17bcdfceae52227afdf497fa8a69d654fa3 /src
parent660eef88e4a0add913e8a147d97b9549162a921e (diff)
downloadcalcurse-edf3903ac840b1889b9bdd687965453a7e26b7ee.tar.gz
calcurse-edf3903ac840b1889b9bdd687965453a7e26b7ee.zip
Avoid core dump if window is too small
Avoid setting the maximum number of items to a negative number (which eventually results in a core dump). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src')
-rw-r--r--src/todo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/todo.c b/src/todo.c
index af25a60..e918905 100644
--- a/src/todo.c
+++ b/src/todo.c
@@ -282,6 +282,9 @@ void todo_update_panel(int which_pan)
int max_items = win[TOD].h - 4;
int incolor = -1;
+ if ((int)win[TOD].h < 4)
+ return;
+
/* Print todo item in the panel. */
erase_window_part(win[TOD].p, 1, title_lines, win[TOD].w - 2, win[TOD].h - 2);
LLIST_FOREACH(&todolist, i) {