+ i = year / 100; + days += i * DAYS100YEARS; + year -= i * 100;
Shouldn't this one be days -= i * DAYS100YEARS; ? On Sat, 6 Sep 2014, Martin Husemann wrote:
Module Name: src Committed By: martin Date: Sat Sep 6 18:04:28 UTC 2014 Modified Files: src/sys/dev: clock_subr.c Log Message: Counting leap years was fine while we had 32bit time_t - but now it is not a good idea for dates far away in the future. For dates in the year 2000 or later, use arithmetic instead (since the repeating periods are well aligned). Should fix PR 49144. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/dev/clock_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
------------------------------------------------------------------------- | Paul Goyette | PGP Key fingerprint: | E-mail addresses: | | (Retired) | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com | | Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net | | Kernel Developer | | pgoyette at netbsd.org | -------------------------------------------------------------------------