Fix a typo of macro name

When the date is 28 Feb in the local timezone and 27 in the UTC,
the leap second info is wrongly calculated, and the Time for 1 Mar
created with a timezone resulted in an invalid date, 30 Feb.
This commit is contained in:
Nobuyoshi Nakada 2022-02-28 12:53:16 +09:00
parent 1cb6790533
commit 32f356e84a
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

2
time.c
View File

@ -1110,7 +1110,7 @@ gmtime_with_leapsecond(const time_t *timep, struct tm *result)
result->tm_yday = leap_year_p(result->tm_year + 1900) ? 365 : 364;
}
else if (result->tm_mday == 1) {
const int8_t *days_in_month = days_in_month_of(result->tm_year + 1900);
const int8_t *days_in_month = days_in_month_in(result->tm_year + 1900);
result->tm_mon--;
result->tm_mday = days_in_month[result->tm_mon];
result->tm_yday--;