From aa73c5ec5a11d821b4a0cdf691924591c0bddfb5 Mon Sep 17 00:00:00 2001 From: Marcin Zelent Date: Mon, 5 Feb 2018 09:41:27 +0100 Subject: Fixed time. --- timetracker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/timetracker.c b/timetracker.c index 6b40695..5a3c35c 100644 --- a/timetracker.c +++ b/timetracker.c @@ -41,9 +41,9 @@ void print_activities(WINDOW *win) for (int i = 0; i < n; ++i) { char name[100][100]; char time[100][8]; - int dur = difftime(activities[i].end, activities[i].start); + long dur = difftime(activities[i].end, activities[i].start); snprintf(name[i], 100, "%-*s", COLS - 7, activities[i].name); - snprintf(time[i], 8, "%0.1f ", dur / 3600); + snprintf(time[i], 8, "%0.1f ", dur / 3600.0f); items[i] = new_item(name[i], time[i]); } items[n] = (ITEM *) NULL; -- cgit v1.2.3