integer options.
Squid3 parses squid.conf file integers as decimal numbers while Squid2 honors
0 and 0x prefixes (indicating octal and hex numbers). The later functionality
is needed for things like unmask that are traditionally specified using octal
format.
This patch changes Squid3 behavior to match that of Squid2.
Internally, Squid3 uses sscanf and Squid2 uses strtol.
TODO: Squid3::GetInteger should probably use xatol,
and xatol should be fixed to proper verify the result of strtol.
if (token == NULL)
self_destruct();
- if (sscanf(token, "%d", &i) != 1)
+ // %i honors 0 and 0x prefixes, which are important for things like umask
+ if (sscanf(token, "%i", &i) != 1)
self_destruct();
return i;