diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2004-12-08 18:12:28 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2004-12-08 18:12:28 +0000 |
commit | 3b54b74f3a2e8ecb1120bfceb090dbf7f3de7f97 (patch) | |
tree | 4d36805e76e669924f1aef742d7939e9c2a5d36c | |
parent | 4b30e15471f321e1332b8494c83d2c38025b75d8 (diff) | |
download | cygnal-3b54b74f3a2e8ecb1120bfceb090dbf7f3de7f97.tar.gz cygnal-3b54b74f3a2e8ecb1120bfceb090dbf7f3de7f97.tar.bz2 cygnal-3b54b74f3a2e8ecb1120bfceb090dbf7f3de7f97.zip |
2004-12-08 Alex Mogilnikov <alx@intellectronika.ru>
* libc/time/tzset_r (_tzset_r): Fix loop.
-rw-r--r-- | newlib/ChangeLog | 4 | ||||
-rw-r--r-- | newlib/libc/time/tzset_r.c | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 24d6b1e8d..bb86b93eb 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,5 +1,9 @@ 2004-12-08 Alex Mogilnikov <alx@intellectronika.ru> + * libc/time/tzset_r (_tzset_r): Fix loop. + +2004-12-08 Alex Mogilnikov <alx@intellectronika.ru> + * libc/time/mktm_r (_mktm_r): Fix overflow calculation for m_day. (__tzcalc_limits): Fix reference to month array to be zero-based. diff --git a/newlib/libc/time/tzset_r.c b/newlib/libc/time/tzset_r.c index ad8267d1b..be121b270 100644 --- a/newlib/libc/time/tzset_r.c +++ b/newlib/libc/time/tzset_r.c @@ -122,11 +122,11 @@ _DEFUN (_tzset_r, (reent_ptr), tzenv += n; - if (*tzenv == ',') - ++tzenv; - for (i = 0; i < 2; ++i) { + if (*tzenv == ',') + ++tzenv; + if (*tzenv == 'M') { if (sscanf (tzenv, "M%hu%n.%hu%n.%hu%n", &m, &n, &w, &n, &d, &n) != 3 || @@ -187,11 +187,14 @@ _DEFUN (_tzset_r, (reent_ptr), hh = 2; mm = 0; ss = 0; + n = 0; if (*tzenv == '/') sscanf (tzenv, "%hu%n:%hu%n:%hu%n", &hh, &n, &mm, &n, &ss, &n); __tzrule[i].s = ss + SECSPERMIN * mm + SECSPERHOUR * hh; + + tzenv += n; } __tzcalc_limits (__tzyear); |