Subject: lib/5158: I think we misuse 'isleap()' in localtime.c
To: None <>
From: Peter Seebach <>
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
>Originator:     Peter Seebach
Plethora Internet
>Release:        -current
System: NetBSD 1.3C NetBSD 1.3C (PUDDLE) #0: Fri Feb 6 11:13:44 CST 1998 i386
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.

Read the code.
Double-check this, and possibly add '+1900' to the %400 check.