Bugzilla bug 247896 and bug 331216: fixed the bug that 'end' was moved one
authorwtchang%redhat.com
Tue, 11 Apr 2006 18:57:07 +0000
changeset 3632 32db9d81c895e689238adc5b098cf959915a17f8
parent 3623 602885a36d8dfc904937d902d723032c1b68fa8c
child 3636 a43edfd07b9d6a16bb7023bcf7029c7bd444c652
push idunknown
push userunknown
push dateunknown
bugs247896, 331216
Bugzilla bug 247896 and bug 331216: fixed the bug that 'end' was moved one character too far when parsing the minutes, and simplified the code. r=timeless,darin.
pr/src/misc/prtime.c
--- a/pr/src/misc/prtime.c
+++ b/pr/src/misc/prtime.c
@@ -1225,23 +1225,19 @@ PR_ParseTimeString(
                                   /* it is [0-9][0-9][0-9]+: */
                                   break;
                                 else if ((end - rest) == 2)
                                   tmp_hour = ((rest[0]-'0')*10 +
                                                           (rest[1]-'0'));
                                 else
                                   tmp_hour = (rest[0]-'0');
 
-                                while (*rest && *rest != ':')
-                                  rest++;
-                                rest++;
-
                                 /* move over the colon, and parse minutes */
 
-                                end = rest + 1;
+                                rest = ++end;
                                 while (*end >= '0' && *end <= '9')
                                   end++;
 
                                 if (end == rest)
                                   /* no digits after first colon? */
                                   break;
                                 else if ((end - rest) > 2)
                                   /* it is [0-9][0-9][0-9]+: */