shithub: scc

Download patch

ref: d5ba7a743aa0a71de85332b403452fa3d498cb35
parent: 919c865b5f8c58a9207b097c467fb94158f3a9b3
author: Hiltjo Posthuma <hiltjo@codemadness.org>
date: Wed Mar 30 16:05:39 EDT 2022

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

Before it subtracted 1900 too soon.

--- a/src/libc/time/gmtime.c
+++ b/src/libc/time/gmtime.c
@@ -25,7 +25,7 @@
 	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;