Subject: Re: isxxx() and toupper() usage changes
To: David Laight <david@l8s.co.uk>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-userlevel
Date: 10/28/2004 05:44:20
--Apple-Mail-23-401175798
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed
On Oct 27, 2004, at 2:00 PM, David Laight wrote:
> Yes, absolutely!!!
>> From www.opengroup.org/onlinepubs/009695399/functions/isdigit.html
>
> The c argument is an int, the value of which the application shall
> ensure is
> a character representable as an unsigned char or equal to the value of
> the
> macro EOF. If the argument has any other value, the behavior is
> undefined.
>
> So if you have a signed char you have to do something to it in order
> not to get the 'undefined' behaviour.
Right, you cast to (unsigned char), you don't mask with 0xff!
-- Jason R. Thorpe <thorpej@shagadelic.org>
--Apple-Mail-23-401175798
content-type: application/pgp-signature; x-mac-type=70674453;
name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)
iD8DBQFBgOmkOpVKkaBm8XkRAtqLAKC7RfWZ/X9u7iJbBl3uOlW3nyW3oACghJfs
0hiZdKQ2nqN2ZY5Qo9hCHSA=
=T31W
-----END PGP SIGNATURE-----
--Apple-Mail-23-401175798--