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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user