summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAriadna Vigo <arivigodr@gmail.com>2020-06-21 00:48:00 +0200
committerAriadna Vigo <arivigodr@gmail.com>2020-06-21 00:48:00 +0200
commitb3ba692f3207c6b61fb35c83b9cd56061a1f9f53 (patch)
tree91ed314e64ee66ee1b0ed8c9ac77450e1e6e0bc9
parent7cfc54b329983b607a06df433284f006396f86fc (diff)
Fixed how we read the expiry date
-rw-r--r--tasklst.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tasklst.c b/tasklst.c
index 4ef1afb..eabff87 100644
--- a/tasklst.c
+++ b/tasklst.c
@@ -73,9 +73,7 @@ tasklst_read_from_file(TaskLst *tasks, FILE *fp)
char *ptr, *endptr;
char linebuf[TASK_LST_DESC_MAX_SIZE];
- fgets(linebuf, sizeof(linebuf), fp);
- tasks->expiry = strtoul(linebuf, &endptr, 10);
- if (endptr[0] != '\n')
+ if (fscanf(fp, "%" SCNd64 "\n", &tasks->expiry) == 0)
return -1;
for (i = 0; i < TASK_LST_MAX_NUM && feof(fp) == 0; ++i) {