Author: emaste
Date: Thu Sep 24 19:37:34 2015
New Revision: 288185
URL: https://svnweb.freebsd.org/changeset/base/288185

Log:
  MFC r283929: Correct grdc(1) 12-hour display between 12:00 and 13:00
  
  PM starts at 12:00, not 13:00.
  
  PR:           194291, 200133
  Submitted by: Nick Price

Modified:
  stable/10/games/grdc/grdc.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/games/grdc/grdc.c
==============================================================================
--- stable/10/games/grdc/grdc.c Thu Sep 24 19:33:35 2015        (r288184)
+++ stable/10/games/grdc/grdc.c Thu Sep 24 19:37:34 2015        (r288185)
@@ -150,14 +150,14 @@ main(int argc, char *argv[])
                set(tm->tm_min/10, 14);
 
                if (t12) {
-                       if (tm->tm_hour > 12) {
-                               tm->tm_hour -= 12;
-                               mvaddstr(YBASE + 5, XBASE + 52, "PM");
-                       } else {
+                       if (tm->tm_hour < 12) {
                                if (tm->tm_hour == 0)
                                        tm->tm_hour = 12;
-
                                mvaddstr(YBASE + 5, XBASE + 52, "AM");
+                       } else {
+                               if (tm->tm_hour > 12)
+                                       tm->tm_hour -= 12;
+                               mvaddstr(YBASE + 5, XBASE + 52, "PM");
                        }
                }
 
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to