Subject: bin/2734: rup -d prints time as 0:xx instead of 12:xx
To: None <gnats-bugs@NetBSD.ORG>
From: Dave Huang <khym@bga.com>
List: netbsd-bugs
Date: 09/04/1996 12:32:54
>Number:         2734
>Category:       bin
>Synopsis:       rup -d prints time as 0:xx instead of 12:xx
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep  4 10:35:00 1996
>Last-Modified:
>Originator:     Dave Huang
>Organization:
Name: Dave Huang     |   Mammal, mammal / their names are called /
INet: khym@bga.com   |   they raise a paw / the bat, the cat /
FurryMUCK: Dahan     |   dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 20 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
>Release:        1.2_BETA
>Environment:
System: NetBSD apm2-108.realtime.net 1.2_BETA NetBSD 1.2_BETA (SPIFF) #21: Sat Aug 3 02:38:23 CDT 1996 khym@apm2-112.realtime.net:/usr/src/sys/arch/i386/compile/SPIFF i386


>Description:
If the time is between 12:00pm and 12:59pm, or between 12:00am and 12:59am, 
rup -d will print the time as 0:xxpm or 0:xxam.

>How-To-Repeat:
Wait until noon, then do rup -d localhost

>Fix:

--- /usr/src/usr.bin/rup/rup.c  Fri Oct 13 22:23:28 1995
+++ rup.c       Wed Sep  4 12:24:42 1996
@@ -216,7 +216,8 @@
                        hours_buf[0] = '\0';
 
        if (printtime)
-               printf(" %2d:%02d%cm", host_time.tm_hour % 12,
+               printf(" %2d:%02d%cm",
+                       (host_time.tm_hour % 12) ? (host_time.tm_hour % 12) : 12,
                        host_time.tm_min,
                        (host_time.tm_hour >= 12) ? 'p' : 'a');
>Audit-Trail:
>Unformatted: