jim 2002/08/20 16:43:28
Modified: strings apr_strings.c
Log:
comment the checks being done, making it clear that the
short-circuit is safe, because we've already noted an
over/underflow (so we're just biding our time)
Revision Changes Path
1.41 +4 -3 apr/strings/apr_strings.c
Index: apr_strings.c
===================================================================
RCS file: /home/cvs/apr/strings/apr_strings.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- apr_strings.c 20 Aug 2002 00:13:19 -0000 1.40
+++ apr_strings.c 20 Aug 2002 23:43:28 -0000 1.41
@@ -355,9 +355,10 @@
if (c >= base)
break;
val *= base;
- if ( (any < 0) || (neg && (val > acc || (val -= c) > acc))
- || (val < acc || (val += c) < acc)) {
- any = -1;
+ if ( (any < 0) /* already noted an over/under flow - short
circuit */
+ || (neg && (val > acc || (val -= c) > acc)) /* underflow */
+ || (val < acc || (val += c) < acc)) { /* overflow */
+ any = -1; /* once noted, over/underflows never go away */
#ifdef APR_STRTOI64_OVERFLOW_IS_BAD_CHAR
break;
#endif