summaryrefslogtreecommitdiff
path: root/src/args.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2014-06-24 23:45:02 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2014-06-25 12:35:43 +0200
commit0529b864b0b2ababd799ee18faf486dbcce68b97 (patch)
treee2eb2cc780396a8065221d19a29d756d5cd2bcb7 /src/args.c
parent0b46ad4faaee1ce982a64413b57406e43cb83e88 (diff)
downloadcalcurse-0529b864b0b2ababd799ee18faf486dbcce68b97.zip
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>
Diffstat (limited to 'src/args.c')
-rw-r--r--src/args.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/args.c b/src/args.c
index f18629c..8b62cb8 100644
--- a/src/args.c
+++ b/src/args.c
@@ -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)