From: André Malo Date: Mon, 24 May 2004 22:55:08 +0000 (+0000) Subject: use new apr_strtoff function to parse limitrequestbody X-Git-Tag: pre_ajp_proxy~234 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b9b5a718a9a00069d6a9a07c5990b470ca1b707;p=apache use new apr_strtoff function to parse limitrequestbody git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103750 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/core.c b/server/core.c index 347d8bd787..bbdd0eb137 100644 --- a/server/core.c +++ b/server/core.c @@ -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."; }