summaryrefslogtreecommitdiffstats
path: root/src/args.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/args.c')
-rw-r--r--src/args.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/args.c b/src/args.c
index 54eb52a..66584cf 100644
--- a/src/args.c
+++ b/src/args.c
@@ -236,8 +236,11 @@ static void next_arg(void)
if (next_app.got_app) {
time_left = next_app.time - current_time;
- hours_left = (time_left / HOURINSEC);
- min_left = (time_left - hours_left * HOURINSEC) / MININSEC;
+ /* In minutes rounded up. */
+ min_left = time_left / MININSEC +
+ (time_left % MININSEC ? 1 : 0);
+ hours_left = min_left / HOURINMIN;
+ min_left = min_left % HOURINMIN;
fputs(_("next appointment:\n"), stdout);
fprintf(stdout, " [%02d:%02d] %s\n", hours_left,
min_left, next_app.txt);