scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 2cfc8424c392d78261013a2436f5985830a9fc0e
parent 8f53790259e45ddf598d1b20c78ca105f44c1f13
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Wed, 30 Mar 2022 20:05:39 +0200

libc: gmtime: use the year for the leap year calculation

Before it subtracted 1900 too soon.

Diffstat:
Msrc/libc/time/gmtime.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libc/time/gmtime.c b/src/libc/time/gmtime.c @@ -25,7 +25,7 @@ gmtime(const time_t *tim) tm.tm_year = i - 1900; tm.tm_yday = day; - _daysmon[FEB] = FEBDAYS(tm.tm_year); + _daysmon[FEB] = FEBDAYS(i); for (i = JAN; day >= _daysmon[i]; i++) day -= _daysmon[i]; tm.tm_mon = i;