Subject: Re: pkg_select upgrade
To: Kibum Han <firstname.lastname@example.org>
From: Jachym Holecek <email@example.com>
Date: 03/17/2005 08:36:59
> > 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... :-(
-- Jachym Holecek