Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site sfmin.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!mhuxm!sftig!sfmin!tg
From: tg@sfmin.UUCP (T.Glinos)
Newsgroups: net.bugs
Subject: Re: XENIX 3.0 toupper() and tolower() broken
Message-ID: <614@sfmin.UUCP>
Date: Sat, 28-Sep-85 20:31:47 EDT
Article-I.D.: sfmin.614
Posted: Sat Sep 28 20:31:47 1985
Date-Received: Mon, 30-Sep-85 01:22:22 EDT
References: <764@fisher.UUCP>
Distribution: net
Organization: AT&T Bell Laboratories, Summit N.J.
Lines: 31

> 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.