]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
use signed long to avoid compiler complaints about the negation of unsigned
authorBrian Pane <brianp@apache.org>
Tue, 18 Jun 2002 04:10:57 +0000 (04:10 +0000)
committerBrian Pane <brianp@apache.org>
Tue, 18 Jun 2002 04:10:57 +0000 (04:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@95758 13f79535-47bb-0310-9956-ffa450edef68

src/ap/ap_strtol.c

index 2a639af603c4c74d8e72c2abad22a7398d92ce32..c374d4cbef36f7e3fd36d23a0ba1d915b6d78c5d 100644 (file)
@@ -118,6 +118,7 @@ API_EXPORT(long) ap_strtol(const char *nptr, char **endptr, int base)
        char c;
        unsigned long cutoff;
        int neg, any, cutlim;
+        long result;
 
        /*
         * Skip white space and pick up leading +/- sign if any.
@@ -189,15 +190,16 @@ API_EXPORT(long) ap_strtol(const char *nptr, char **endptr, int base)
                }
        }
        if (any < 0) {
-               acc = neg ? LONG_MIN : LONG_MAX;
+               result = neg ? LONG_MIN : LONG_MAX;
                errno = ERANGE;
        } else if (!any) {
 noconv:
+                result = (long)acc;
                errno = EINVAL;
        } else if (neg)
-               acc = -acc;
+               result = -(long)acc;
        if (endptr != NULL)
                *endptr = (char *)(any ? s - 1 : nptr);
-       return (acc);
+       return (result);
 }