From 77d91a57f896a14746481dae1ddbf1fc02e13737 Mon Sep 17 00:00:00 2001 From: Ariadna Vigo Date: Sat, 20 Jun 2020 23:44:01 +0200 Subject: Fixed expiration mechanism --- cras.c | 2 +- tasklst.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cras.c b/cras.c index 86f8ec5..fca9af0 100644 --- a/cras.c +++ b/cras.c @@ -89,7 +89,7 @@ read_crasfile(TaskLst *tasks, const char *crasfile) if (read_stat < 0) die("Parsing error: task file corrupted."); - if (tasklst_expired(*tasks) == 0) + if (tasklst_expired(*tasks) > 0) die("Current task file expired: Set a new one!"); } diff --git a/tasklst.c b/tasklst.c index 84d674e..f19aa0c 100644 --- a/tasklst.c +++ b/tasklst.c @@ -44,7 +44,7 @@ tasklst_set_expiration(TaskLst *tasks) int tasklst_expired(TaskLst tasks) { - return ((time(NULL) - tasks.expiry) > TASK_LST_EXPIRY) ? 0 : -1; + return (time(NULL) > tasks.expiry) ? 1 : 0; } int -- cgit v1.2.3