summaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/utils.c b/src/utils.c
index bd5ff70..41bebee 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -1238,15 +1238,12 @@ static void print_date(long date, long day, const char *extformat)
}
/* Print a time difference to stdout. */
-static void print_datediff(long date, const char *extformat)
+static void print_datediff(long difference, const char *extformat)
{
const char *p;
const char *numfmt;
bool usetotal;
long value;
- time_t difference;
-
- difference = difftime(date, now());
if (!strcmp(extformat, "epoch")) {
printf("%ld", difference);
@@ -1335,7 +1332,8 @@ void print_apoint(const char *format, long day, struct apoint *apt)
extformat);
break;
case FS_REMAINING:
- print_datediff(apt->start, extformat);
+ print_datediff(difftime(apt->start, now()),
+ extformat);
break;
case FS_MESSAGE:
printf("%s", apt->mesg);