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>
This commit is contained in:
parent
660eef88e4
commit
edf3903ac8
@ -282,6 +282,9 @@ void todo_update_panel(int which_pan)
|
|||||||
int max_items = win[TOD].h - 4;
|
int max_items = win[TOD].h - 4;
|
||||||
int incolor = -1;
|
int incolor = -1;
|
||||||
|
|
||||||
|
if ((int)win[TOD].h < 4)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Print todo item in the panel. */
|
/* Print todo item in the panel. */
|
||||||
erase_window_part(win[TOD].p, 1, title_lines, win[TOD].w - 2, win[TOD].h - 2);
|
erase_window_part(win[TOD].p, 1, title_lines, win[TOD].w - 2, win[TOD].h - 2);
|
||||||
LLIST_FOREACH(&todolist, i) {
|
LLIST_FOREACH(&todolist, i) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user