Subject: lib/5183: strptime(3) still has a bug about "%I %p"
To: None <gnats-bugs@gnats.netbsd.org>
From: NAKAJIMA Yoshihiro <nakayosh@kcn.or.jp>
List: netbsd-bugs
Date: 03/23/1998 00:53:18
>Number:         5183
>Category:       lib
>Synopsis:       strptime(3) still has a bug about "%I %p"
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 22 08:05:01 1998
>Last-Modified:
>Originator:     NAKAJIMA Yoshihiro
>Organization:
>Release:        NetBSD-current 98/03/21
>Environment:
System: NetBSD asura 1.3E NetBSD 1.3E (ASURA) #5: Sun Mar 22 23:19:51 JST 1998 nakayosh@asura:/usr/src/sys/arch/i386/compile/ASURA i386


>Description:
	Revision 1.13 of strptime(3) still has a bug about "%I %p".

>How-To-Repeat:
% cat test.c
#include <stdio.h>
#include <time.h>

int main(void)
{
    struct tm tm;
    const char *buffer = "12 AM";	/* noon */

    strptime(buffer, "%I %p", &tm);
    printf("\"%s\" => tm_hour=%d\n", buffer, tm.tm_hour);

    return 0;
}
% cc test.c
% ./a.out 
"12 AM" => tm_hour=0

>Fix:
>Audit-Trail:
>Unformatted: