This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
mktime()
- From: Steven Abner <pheonix at zoomtown dot com>
- To: newlib at sourceware dot org
- Date: Mon, 22 Aug 2011 14:31:51 -0400
- Subject: mktime()
- Authentication-results: ecout1 smtp.mail=pheonix@zoomtown.com; spf=unknown
- Authentication-results: ecout1 smtp.user=pheonix@zoomtown.com; auth=pass (LOGIN)
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