summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAriadna Vigo <arivigodr@gmail.com>2020-07-24 19:52:26 +0200
committerAriadna Vigo <arivigodr@gmail.com>2020-07-24 19:52:26 +0200
commit95704a9cf40e456d882cf369f63851f4d29efb61 (patch)
treedb2aef6a8eb67b70d4a28da0e1d5c2dc7905f2d9
parentf4b3177bbd0e9b46eb078f199d57fcf120c2f88e (diff)
Fixed how we interpret fscanf() return values
-rw-r--r--tasklst.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tasklst.c b/tasklst.c
index 09c6b6d..ed3d3e5 100644
--- a/tasklst.c
+++ b/tasklst.c
@@ -89,7 +89,7 @@ tasklst_read_from_file(TaskLst *tasks, FILE *fp)
char *ptr, *endptr;
char linebuf[TASK_LST_DESC_MAX_SIZE];
- if (fscanf(fp, "%" SCNd64 "\n", &tasks->expiry) == 0)
+ if (fscanf(fp, "%" SCNd64 "\n", &tasks->expiry) <= 0)
return -1;
for (i = 0; i < TASK_LST_MAX_NUM && feof(fp) == 0; ++i) {