From: Ben Harris Date: Sat, 24 Nov 2018 10:38:07 +0000 (+0000) Subject: When recording dial time, write "12" instead of "0" for the hour. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=b9e44d4965f10dab98aeda3af341aadd67b863c9;p=clunk.git 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. --- 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;