From 95704a9cf40e456d882cf369f63851f4d29efb61 Mon Sep 17 00:00:00 2001 From: Ariadna Vigo Date: Fri, 24 Jul 2020 19:52:26 +0200 Subject: Fixed how we interpret fscanf() return values --- tasklst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- cgit v1.2.3