summaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorwill <will@FreeBSD.org>2003-06-23 16:01:11 +0000
committerwill <will@FreeBSD.org>2003-06-23 16:01:11 +0000
commit003ad51e2a838e6362bbbc83a53f397c3713bb53 (patch)
tree30684b54b766cd438502c33cbc216fc6335f1e4f /games
parentbc7d9d78f7464b4c67e202934e3f8412170c87a6 (diff)
downloadFreeBSD-src-003ad51e2a838e6362bbbc83a53f397c3713bb53.zip
FreeBSD-src-003ad51e2a838e6362bbbc83a53f397c3713bb53.tar.gz
Handle 12-hour clocks properly: when the time is 00:00-00:59, adjust the
hour to 12 so the time reads "12:00-12:59 AM".
Diffstat (limited to 'games')
-rw-r--r--games/grdc/grdc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/games/grdc/grdc.c b/games/grdc/grdc.c
index 1c79c8c..d27b10e 100644
--- a/games/grdc/grdc.c
+++ b/games/grdc/grdc.c
@@ -149,8 +149,12 @@ int t12;
if (tm->tm_hour > 12) {
tm->tm_hour -= 12;
mvaddstr(YBASE + 5, XBASE + 52, "PM");
- } else
+ } else {
+ if (tm->tm_hour == 0)
+ tm->tm_hour = 12;
+
mvaddstr(YBASE + 5, XBASE + 52, "AM");
+ }
}
set(tm->tm_hour%10, 20);
OpenPOWER on IntegriCloud