Fix segmentation fault

This adds some more accurate checks to avoid a segmentation fault that
occurred when accessing a nonexistent item.

Fixes GitHub issue #7.

Reported-by: Bromind <martin.vassor@hotmail.fr>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2014-06-24 23:45:02 +02:00
parent 0b46ad4faa
commit 0529b864b0
4 changed files with 16 additions and 14 deletions

View File

@@ -309,7 +309,7 @@ app_arg(int add_line, struct date *day, long date, const char *fmt_apt,
day_store_items(date, regex, 0);
int n = day_item_count();
int n = day_item_count(0);
if (n > 0) {
if (add_line)