int
isUnsignedNumeric(const char *str)
{
for (; *str; str++) {
if (! isdigit(*str))
return -1;
}
return 1;
}
2009/5/25 Adrian Chadd <adrian_at_squid-cache.org>:
> strtoul(). But if you want to verify the -whole- thing is numeric,
> just write a bit of C which does this:
>
> int isNumeric(const char *str)
> {
>
> }
>
> 2009/5/25 Amos Jeffries <squid3_at_treenet.co.nz>:
>> Guido Serassio wrote:
>>>
>>> Hi,
>>>
>>> At 16.17 24/05/2009, Adrian Chadd wrote:
>>>>
>>>> Well as Amos said, this isn't the way to call getservbyname().
>>>>
>>>> getservbyname() doesn't translate ports to ports; it translates
>>>> tcp/udp service names to ports. It should be returning NULL if it
>>>> can't find the service string in the file.
>>>>
>>>> Methinks numeric values shouldn't be handed to getservbyname() under
>>>> Windows. :)
>>>
>>> So, we have just found a Squid bug .... :-)
>>>
>>> Regards
>>
>> Yes. Question becomes though, fastest way to detect numeric-only strings.
>>
>> Amos
>> --
>> Please be using
>> Current Stable Squid 2.7.STABLE6 or 3.0.STABLE15
>> Current Beta Squid 3.1.0.8 or 3.0.STABLE16-RC1
>>
>>
>
Received on Mon May 25 2009 - 12:22:04 MDT
This archive was generated by hypermail 2.2.0 : Mon May 25 2009 - 12:00:02 MDT