We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9bf3a54 commit 3ca5cd5Copy full SHA for 3ca5cd5
components/libc/compilers/common/ctime.c
@@ -391,7 +391,6 @@ time_t timegm(struct tm * const t)
391
return (time_t)-1;
392
}
393
394
- years = (time_t)t->tm_year - 70;
395
if (t->tm_sec > 60) /* seconds after the minute - [0, 60] including leap second */
396
{
397
t->tm_min += t->tm_sec / 60;
@@ -433,6 +432,8 @@ time_t timegm(struct tm * const t)
433
432
return (time_t) -1;
434
435
+ years = (time_t)t->tm_year - 70;
436
+
437
/* Days since 1970 is 365 * number of years + number of leap years since 1970 */
438
day = years * 365 + (years + 1) / 4;
439
0 commit comments