XENIX 3.0 toupper() and tolower() broken

T.Glinos tg at sfmin.UUCP
Sun Sep 29 10:31:47 AEST 1985


> Found this one while trying to make sendmail work,... all the lines of
> the form
> From:
> To:
> Date:
> came out of the form
> Rom:
> O:
> Ate:
> 
> Seems that the XENIX 3.0 ctype.h has toupper() and tolower() defined as
> macros like this,...
> #define toupper(x) (ifsomething(x) ? dosomething(x) : (x))
> which breaks badly if (x) is autoincrement or autodecrement. Ie.
> toupper(s++) goes to (ifsomething(s++) ? donesomething(s++) : (s++)),
> which is clearly wrong.
> 
> The fix is to ctype.h, to not use the trinary operator; or to use the
> libc versions instead (by #undef'ing toupper() and tolower());
> 
> NB:  This only holds for the Intel distribution, I have not checked the
> IBM XENIX 3.0 release.
> 
> -- 
> 			***dan
> 
> {allegra,astrovax,princeton,twg}!fisher!djl
> The misplaced (You call *that* a ski slope??) Californian

*** REPLACE THIS LINE WITH YOUR MESSAGE ***
XENIX System V has this all fixed.



More information about the Net.bugs mailing list