[BusyBox] EOF != (char)EOF

Erik Andersen andersen at lineo.com
Mon Jul 17 16:35:31 UTC 2000


On Mon Jul 17, 2000 at 12:11:53PM -0400, Pavel Roskin wrote:
> Hello!
> 
> Please don't ever put the result of getopt() to a char variable!
> This way you cannot distinguish between '\0xff' and EOF.
> This is fatal for PPC where "char" is unsigned by default, so
> 
> EOF != (char)EOF
> 
> But it is bad for other architectures too because you lose the ability to
> use international characters. '\0xff' is meaningful in several encodings.
> One must be a strange guy to run
> 
> eval `echo -e 'date -\377'`
> 
> but don't forget that crackers are strange guys too. Besides, clean code
> is better than dirty code.

Thanks for the reminder and the fix you just checked in.  I'll try to
watch the checkins more closely to make sure we don't mess it up again,

 -Erik

--
Erik B. Andersen   email:  andersen at lineo.com
--This message was written using 73% post-consumer electrons--





More information about the busybox mailing list