Subject: bin/482: getty fails to print date properly
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: John Kohl <jtk@kolvir.blrc.ma.us>
List: netbsd-bugs
Date: 09/17/1994 15:50:04
>Number:         482
>Category:       bin
>Synopsis:       getty fails to print date properly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 17 15:50:03 1994
>Originator:     John Kohl
>Organization:
>Release:        
>Environment:
System: NetBSD kolvir 1.0_BETA NetBSD 1.0_BETA (KOLVIR) #16: Thu Sep 15 22:03:20 EDT 1994 jtk@kolvir:/u1/NetBSD-1.0/src/sys/arch/i386/compile/KOLVIR i386


>Description:
/usr/libexec/getty doesn't properly interpret the '%d' escape.  It tries
to use %P to get AM or PM, but instead all it gets is "P".

>How-To-Repeat:
put %d into your getty im= string, and watch the date come out bogus.
>Fix:

===================================================================
RCS file: RCS/main.c,v
retrieving revision 1.1
diff -c -r1.1 main.c
*** 1.1	1994/09/17 19:31:40
--- main.c	1994/09/17 19:35:15
***************
*** 523,529 ****
  			break;
  
  		case 'd': {
! 			static char fmt[] = "%l:% %P on %A, %d %B %Y";
  
  			fmt[4] = 'M';		/* I *hate* SCCS... */
  			(void)time(&t);
--- 523,529 ----
  			break;
  
  		case 'd': {
! 			static char fmt[] = "%l:% %p on %A, %d %B %Y";
  
  			fmt[4] = 'M';		/* I *hate* SCCS... */
  			(void)time(&t);
>Audit-Trail:
>Unformatted: