From b9e44d4965f10dab98aeda3af341aadd67b863c9 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 24 Nov 2018 10:38:07 +0000 Subject: [PATCH] When recording dial time, write "12" instead of "0" for the hour. 12-hour clocks are generally thought of a running from 1 to 12, not from 0 to 11. --- clunk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clunk.c b/clunk.c index 853299d..868a5c8 100644 --- a/clunk.c +++ b/clunk.c @@ -103,8 +103,9 @@ record_tick(void) * simple case like this. */ printed = snprintf(statebuf, 10, "%2d:%02d:%02d\n", - displayed.tm_hour, displayed.tm_min, - displayed.tm_sec); + displayed.tm_hour == 0 ? + 12 : displayed.tm_hour, + displayed.tm_min, displayed.tm_sec); assert(printed == 9); stateaio.aio_fildes = statefd; stateaio.aio_buf = statebuf; -- 2.30.2