wrowe 2002/08/04 10:22:02
Modified: strings apr_strings.c
Log:
c is the valid first digit, must use it for the first iteration
Revision Changes Path
1.37 +3 -2 apr/strings/apr_strings.c
Index: apr_strings.c
===================================================================
RCS file: /home/cvs/apr/strings/apr_strings.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- apr_strings.c 4 Aug 2002 04:28:41 -0000 1.36
+++ apr_strings.c 4 Aug 2002 17:22:02 -0000 1.37
@@ -326,7 +326,7 @@
* overflow.
*/
val = 0;
- while (acc >= 0 && (c = *s++)) {
+ do {
if (c >= '0' && c <= '9')
c -= '0';
#if (('Z' - 'A') == 25)
@@ -362,7 +362,8 @@
acc = val;
any = 1;
}
- }
+ } while (any >= 0 && (c = *s++));
+
if (any < 0) {
acc = neg ? INT64_MIN : INT64_MAX;
errno = ERANGE;