]> granicus.if.org Git - apache/commitdiff
use new apr_strtoff function to parse limitrequestbody
authorAndré Malo <nd@apache.org>
Mon, 24 May 2004 22:55:08 +0000 (22:55 +0000)
committerAndré Malo <nd@apache.org>
Mon, 24 May 2004 22:55:08 +0000 (22:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103750 13f79535-47bb-0310-9956-ffa450edef68

server/core.c

index 347d8bd787e1bad67e6473f3ea343dcdf1f69810..bbdd0eb137bff3af4056bd6e05cda8fa05ffc790 100644 (file)
@@ -2598,12 +2598,10 @@ static const char *set_limit_req_body(cmd_parms *cmd, void *conf_,
         return err;
     }
 
-    /* WTF: If strtoul is not portable, then write a replacement.
-     *      Instead we have an idiotic define in httpd.h that prevents
-     *      it from being used even when it is available. Sheesh.
-     */
-    conf->limit_req_body = (apr_off_t)strtol(arg, &errp, 10);
-    if (*errp != '\0') {
+    if (APR_SUCCESS != apr_strtoff(&conf->limit_req_body, arg, &errp, 10)) {
+        return "LimitRequestBody argument is not parsable.";
+    }
+    if (*errp || conf->limit_req_body < 0) {
         return "LimitRequestBody requires a non-negative integer.";
     }