pkgsrc-WIP-review archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg_select upgrade



> > isdigit(3) says the prototype is "int isdigit(int c);", so #1 would seem
> > correct.
> 
> No, it is completely wrong and the VERY reason that gcc gives a warning
> in this case.
> 
> The domain of all the isxxx() functions is EOF plus all the values of
> unsigned char, typically -1..255.  So if your signed char buf[n] contains
> a negative value then the wrong things happen unless you cast to
> unsigned char first.
> 
> Remember that isalpha() can be valid for -ve chars.
> 
> Of course, things will go terribly wrong if isdigit() returns non-zero
> for anything other that '0'..'9'.

Eh, I see. Sorry for noise, I must be on coke this morning... :-(

        Regards,
                -- Jachym Holecek


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
pkgsrc-wip-review mailing list
pkgsrc-wip-review%lists.sourceforge.net@localhost
https://lists.sourceforge.net/lists/listinfo/pkgsrc-wip-review



Home | Main Index | Thread Index | Old Index