]> granicus.if.org Git - apache/commitdiff
Consistently use base 10 for numbers when parsing config options. It may be
authorStefan Fritsch <sf@apache.org>
Sun, 9 Oct 2011 18:58:21 +0000 (18:58 +0000)
committerStefan Fritsch <sf@apache.org>
Sun, 9 Oct 2011 18:58:21 +0000 (18:58 +0000)
confusing to the user if some directives treat a number with leading zero as
octal while most don't.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180687 13f79535-47bb-0310-9956-ffa450edef68

modules/aaa/mod_auth_form.c
modules/cache/mod_cache_disk.c
modules/filters/mod_buffer.c
modules/filters/mod_request.c
server/mpm_common.c

index c713aac20b5101144b401ddccd65a49bb9f43601..1a60e2a5a1b7ead162a5cd190a8cb45b860b3d69 100644 (file)
@@ -277,7 +277,7 @@ static const char *set_cookie_form_size(cmd_parms * cmd, void *config,
     auth_form_config_rec *conf = config;
     apr_off_t size;
 
-    if (APR_SUCCESS != apr_strtoff(&size, arg, NULL, 0)
+    if (APR_SUCCESS != apr_strtoff(&size, arg, NULL, 10)
         || size < 0 || size > APR_SIZE_MAX) {
         return "AuthCookieFormSize must be a size in bytes, or zero.";
     }
index 847135ce35ee90ffd1c6968a3855b10e1f3f092d..1ceb962bea12302d602d7972002731645e26a239 100644 (file)
@@ -1396,7 +1396,7 @@ static const char
 {
     disk_cache_dir_conf *dconf = (disk_cache_dir_conf *)in_struct_ptr;
 
-    if (apr_strtoff(&dconf->minfs, arg, NULL, 0) != APR_SUCCESS ||
+    if (apr_strtoff(&dconf->minfs, arg, NULL, 10) != APR_SUCCESS ||
             dconf->minfs < 0)
     {
         return "CacheMinFileSize argument must be a non-negative integer representing the min size of a file to cache in bytes.";
@@ -1409,7 +1409,7 @@ static const char
 {
     disk_cache_dir_conf *dconf = (disk_cache_dir_conf *)in_struct_ptr;
 
-    if (apr_strtoff(&dconf->maxfs, arg, NULL, 0) != APR_SUCCESS ||
+    if (apr_strtoff(&dconf->maxfs, arg, NULL, 10) != APR_SUCCESS ||
             dconf->maxfs < 0)
     {
         return "CacheMaxFileSize argument must be a non-negative integer representing the max size of a file to cache in bytes.";
@@ -1422,7 +1422,7 @@ static const char
 {
     disk_cache_dir_conf *dconf = (disk_cache_dir_conf *)in_struct_ptr;
 
-    if (apr_strtoff(&dconf->readsize, arg, NULL, 0) != APR_SUCCESS ||
+    if (apr_strtoff(&dconf->readsize, arg, NULL, 10) != APR_SUCCESS ||
             dconf->readsize < 0)
     {
         return "CacheReadSize argument must be a non-negative integer representing the max amount of data to cache in go.";
@@ -1437,7 +1437,7 @@ static const char
     disk_cache_dir_conf *dconf = (disk_cache_dir_conf *)in_struct_ptr;
     apr_off_t milliseconds;
 
-    if (apr_strtoff(&milliseconds, arg, NULL, 0) != APR_SUCCESS ||
+    if (apr_strtoff(&milliseconds, arg, NULL, 10) != APR_SUCCESS ||
             milliseconds < 0)
     {
         return "CacheReadTime argument must be a non-negative integer representing the max amount of time taken to cache in go.";
index dac24e77f8176ce7e97fb2296eb6c19ad27c9a9a..5e9625de223d083705b80ddb8fef23db7a0d5373 100644 (file)
@@ -311,7 +311,7 @@ static void *merge_buffer_config(apr_pool_t *p, void *basev, void *addv) {
 static const char *set_buffer_size(cmd_parms *cmd, void *dconf, const char *arg) {
     buffer_conf *conf = dconf;
 
-    if (APR_SUCCESS != apr_strtoff(&(conf->size), arg, NULL, 0) || conf->size
+    if (APR_SUCCESS != apr_strtoff(&(conf->size), arg, NULL, 10) || conf->size
             <= 0) {
         return "BufferSize must be a size in bytes, and greater than zero";
     }
index cebe539a19fc30d9bc82301059d9386313ed3626..77842c6f6d114f33be05ec0c8fe547e441814b7f 100644 (file)
@@ -357,7 +357,7 @@ static const char *set_kept_body_size(cmd_parms *cmd, void *dconf,
     request_dir_conf *conf = dconf;
     char *end = NULL;
 
-    if (APR_SUCCESS != apr_strtoff(&(conf->keep_body), arg, &end, 0)
+    if (APR_SUCCESS != apr_strtoff(&(conf->keep_body), arg, &end, 10)
             || conf->keep_body < 0 || end) {
         return "KeptBodySize must be a valid size in bytes, or zero.";
     }
index aee3f18c1fe4cfe23cb97a5442ddfcd6228387cd..d35d349a5040bbffc589562fa280d42519710275 100644 (file)
@@ -372,7 +372,7 @@ const char *ap_mpm_set_max_mem_free(cmd_parms *cmd, void *dummy,
         return err;
     }
 
-    value = strtol(arg, NULL, 0);
+    value = strtol(arg, NULL, 10);
     if (value < 0 || errno == ERANGE)
         return apr_pstrcat(cmd->pool, "Invalid MaxMemFree value: ",
                            arg, NULL);
@@ -391,7 +391,7 @@ const char *ap_mpm_set_thread_stacksize(cmd_parms *cmd, void *dummy,
         return err;
     }
 
-    value = strtol(arg, NULL, 0);
+    value = strtol(arg, NULL, 10);
     if (value < 0 || errno == ERANGE)
         return apr_pstrcat(cmd->pool, "Invalid ThreadStackSize value: ",
                            arg, NULL);