From 3b54b74f3a2e8ecb1120bfceb090dbf7f3de7f97 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 8 Dec 2004 18:12:28 +0000 Subject: 2004-12-08 Alex Mogilnikov * libc/time/tzset_r (_tzset_r): Fix loop. --- newlib/libc/time/tzset_r.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'newlib/libc') 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); -- cgit v1.2.3