scc

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

commit c7111312b27a90c04e7487a3f97123f9f8145670
parent 43bd1434081e8789eabfa11607528dd3ccd3f33b
Author: Naveen Narayanan <zerous@simple-cc.org>
Date:   Fri, 28 Aug 2020 11:15:53 +0200

libc: Fix bug in normalize (mktime)

Diffstat:
Msrc/libc/time/mktime.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libc/time/mktime.c b/src/libc/time/mktime.c @@ -43,7 +43,7 @@ normalize(struct tm *tm) } day = tm->tm_mday; - year = EPOCH + tm->tm_year; + year = 1900 + tm->tm_year; _daysmon[FEB] = FEBDAYS(year); for (mon = tm->tm_mon; day < 1; --mon) { @@ -69,7 +69,7 @@ normalize(struct tm *tm) } tm->tm_mon = mon; - tm->tm_year = year - EPOCH; + tm->tm_year = year - 1900; tm->tm_mday = day; tm->tm_wday = (_newyear(tm->tm_year) + tm->tm_yday) % 7;