diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2005-02-25 22:31:21 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2005-02-25 22:31:21 +0000 |
commit | 1139537a2536b2ca1632f5ab991935ba25068bcb (patch) | |
tree | 083b83bc1087094af4a566d7167ef1590d8943b9 /newlib/libc/time/mktm_r.c | |
parent | 6d11044c633bc7aca545c5409327ef023646205b (diff) | |
download | cygnal-1139537a2536b2ca1632f5ab991935ba25068bcb.tar.gz cygnal-1139537a2536b2ca1632f5ab991935ba25068bcb.tar.bz2 cygnal-1139537a2536b2ca1632f5ab991935ba25068bcb.zip |
2005-02-25 Eric Blake <ebb9@byu.net>
* libc/include/time.h (__tzrule_struct): Make offset long, since
a 16-bit int overflows on a 12-hour offset.
* libc/sys/linux/include/time.h: Ditto.
* libc/time/mktime.c (mktime): Use new type of __tzrule.offset.
* libc/time/mktm_r.c: Ditto.
* libc/time/gettzinfo.c: Ditto.
* libc/time/strftime.c (strftime): Fix '%x' to deal with negative
years. Fix '%z' to use long, not int.
Diffstat (limited to 'newlib/libc/time/mktm_r.c')
-rw-r--r-- | newlib/libc/time/mktm_r.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/newlib/libc/time/mktm_r.c b/newlib/libc/time/mktm_r.c index 9cea60b7f..4d4b4fab0 100644 --- a/newlib/libc/time/mktm_r.c +++ b/newlib/libc/time/mktm_r.c @@ -95,7 +95,7 @@ _DEFUN (_mktm_r, (tim_p, res, is_gmtime), if (!is_gmtime) { - int offset; + long offset; int hours, mins, secs; TZ_LOCK; @@ -117,11 +117,11 @@ _DEFUN (_mktm_r, (tim_p, res, is_gmtime), ? tz->__tzrule[1].offset : tz->__tzrule[0].offset); - hours = offset / SECSPERHOUR; + hours = (int) (offset / SECSPERHOUR); offset = offset % SECSPERHOUR; - mins = offset / SECSPERMIN; - secs = offset % SECSPERMIN; + mins = (int) (offset / SECSPERMIN); + secs = (int) (offset % SECSPERMIN); res->tm_sec -= secs; res->tm_min -= mins; |