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 <squ...@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 > >