]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix 'ERROR: A percentage value is missing.'
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 29 Jul 2013 17:34:48 +0000 (11:34 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 29 Jul 2013 17:34:48 +0000 (11:34 -0600)
This usage of strtok() appears to have been omitted from rev.12949

src/Parsing.cc

index 267ed6775633e6bde13ff1089685c88ad3619608..22ea60152a8183096979e352945c6a9daecd26d4 100644 (file)
@@ -189,8 +189,7 @@ GetInteger(void)
 int
 GetPercentage(void)
 {
-    int p;
-    char *token = strtok(NULL, w_space);
+    char *token = ConfigParser::NextToken();
 
     if (!token) {
         debugs(0, DBG_PARSE_NOTE(DBG_IMPORTANT), "ERROR: A percentage value is missing.");
@@ -203,7 +202,7 @@ GetPercentage(void)
         *end = '\0';
     }
 
-    p = xatoi(token);
+    int p = xatoi(token);
 
     if (p < 0 || p > 100) {
         debugs(0, DBG_PARSE_NOTE(DBG_IMPORTANT), "ERROR: The value '" << token << "' is out of range. A percentage should be within [0, 100].");