summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Zelent <zelent.marcin@gmail.com>2018-02-05 09:41:27 +0100
committerMarcin Zelent <zelent.marcin@gmail.com>2018-02-05 09:41:27 +0100
commitaa73c5ec5a11d821b4a0cdf691924591c0bddfb5 (patch)
tree3bb2b1de0dbd8849bccd1389f444701af15956fb
parent8d0fb0118890ff067c8b0024d1fd6d8e19c8044d (diff)
Fixed time.
-rw-r--r--timetracker.c4
1 files 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;