mktime()
Steven Abner
pheonix@zoomtown.com
Tue Aug 23 05:09:00 GMT 2011
Hi gang;
Came across a discrepancy in the handling between localtime and mktime. In the file mktm_r.c, the function _mktm_r has:
res->tm_yday = 365 + isleap(res->tm_year);
I believe it should be:
res->tm_yday = 364 + isleap(res->tm_year);
A test using localtime to create the broken-down time, then perform the inverse, mktime, showed that localtime created tm_yday of 365 then mktime corrected it to 364.
Cheers,
Steve
More information about the Newlib
mailing list