Subject: lib/5158: I think we misuse 'isleap()' in localtime.c
To: None <gnats-bugs@gnats.netbsd.org>
From: Peter Seebach <seebs@puddle.plethora.net>
List: netbsd-bugs
Date: 03/12/1998 22:17:02
>Number:         5158
>Category:       lib
>Synopsis:       isleap appears to be called on tm_year, which is off by 1900
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 12 22:20:01 1998
>Last-Modified:
>Originator:     Peter Seebach
>Organization:
Plethora Internet
>Release:        -current
>Environment:
System: NetBSD puddle.plethora.net 1.3C NetBSD 1.3C (PUDDLE) #0: Fri Feb 6 11:13:44 CST 1998 seebs@puddle.plethora.net:/mud/src/sys/arch/i386/compile/PUDDLE i386
>Description:
Reading localtime.c, it really looks to me as though 'isleap()' (the macro
for detecting leap years) is being called on the 'tm_year' structure member.
Unfortunately, that's off by 1900 for the '%400' test.

>How-To-Repeat:
Read the code.
>Fix:
Double-check this, and possibly add '+1900' to the %400 check.
>Audit-Trail:
>Unformatted: