Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!bellcore!texbell!nuchat!sugar!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: Style (was: C-DATABASE B-PLUS a quick look) Message-ID: <2581@ficc.uu.net> Date: 29 Dec 88 19:49:21 GMT References: <2537@xyzzy.UUCP> Organization: Xenix Support Lines: 29 In article <2537@xyzzy.UUCP>, throopw@xyzzy.UUCP (Wayne A. Throop) writes: > #include > char *p, *s; > ... > for( p = s; *p; ++p ) > *p = toupper( *p ); > Nearly as I can tell, dpANS says that loop ought to have been > for( p = s; *p ++p ) > if( *p >= 0 ) > *p = toupper( *p ); Gee, I always do this: for(p = s; *p; p++) if(islower(*p)) *p = toupper(*p); While dpANS might have decided that toupper should bounds check, there are too many V7-oid compilers out there that it's better to put the bounds check in. Personally, I think that toupper should have been left the way it was. Everything else in stdio forces you to do your own bounds checking, so why should this be an exception? -- Peter da Silva, Xenix Support, Ferranti International Controls Corporation. Work: uunet.uu.net!ficc!peter, peter@ficc.uu.net, +1 713 274 5180. `-_-' Home: bigtex!texbell!sugar!peter, peter@sugar.uu.net. 'U` Opinions may not represent the policies of FICC or the Xenix Support group.