diff options
-rw-r--r-- | newlib/ChangeLog | 4 | ||||
-rw-r--r-- | newlib/libc/time/mktm_r.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index f3f6a96c8..b9fbc82e6 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2011-08-24 Corinna Vinschen <vinschen@redhat.com> + + * libc/time/mktm_r.c (_mktm_r): Fix computing tm_year. + 2011-08-23 Ralf Corsépius <ralf.corsepius@rtems.org> * libc/stdlib/putenv_r.c: Use "strchr" instead of obsolete "index". diff --git a/newlib/libc/time/mktm_r.c b/newlib/libc/time/mktm_r.c index 4d4b4fab0..9b9b411a5 100644 --- a/newlib/libc/time/mktm_r.c +++ b/newlib/libc/time/mktm_r.c @@ -182,7 +182,7 @@ _DEFUN (_mktm_r, (tim_p, res, is_gmtime), { res->tm_mon = 11; res->tm_year -= 1; - res->tm_yday = 365 + isleap(res->tm_year); + res->tm_yday = 364 + isleap(res->tm_year); } res->tm_mday = ip[res->tm_mon]; } |