diff options
author | Ariadna Vigo <arivigodr@gmail.com> | 2020-06-21 00:48:00 +0200 |
---|---|---|
committer | Ariadna Vigo <arivigodr@gmail.com> | 2020-06-21 00:48:00 +0200 |
commit | b3ba692f3207c6b61fb35c83b9cd56061a1f9f53 (patch) | |
tree | 91ed314e64ee66ee1b0ed8c9ac77450e1e6e0bc9 | |
parent | 7cfc54b329983b607a06df433284f006396f86fc (diff) |
Fixed how we read the expiry date
-rw-r--r-- | tasklst.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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) { |