Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!lll-lcc!lll-tis!ptsfa!hoptoad!academ!uhnix1!sugar!peter From: peter@sugar.UUCP Newsgroups: comp.unix.xenix Subject: Re: New bug in uPort: stdio is broken. Message-ID: <612@sugar.UUCP> Date: Tue, 1-Sep-87 13:49:33 EDT Article-I.D.: sugar.612 Posted: Tue Sep 1 13:49:33 1987 Date-Received: Thu, 3-Sep-87 06:23:36 EDT References: <593@sugar.UUCP> <202@hobbes.UUCP> Organization: Sugar Land UNIX - Houston, TX Lines: 43 Summary: Mea Culpa In article <202@hobbes.UUCP>, root@hobbes.UUCP (John Plocher) writes: > +---- Peter da Silva writes the following in article <593@sugar.UUCP> ---- > | [[ concerning a "supposed" bug in Microport SV/AT ]] > Not a bug in stdio - replace the "printf("");" with "strlen("");" and it works, > too. The *REAL* bug is that your code is corrupting the stack, specifically > the call to strchr(). You have reversed the arguments to the function. You're right. My only possible excuse is I'm a Version 7 fan from way, and I don't see any good reason for renaming "index()" as "strchr()"... I have a mental block about strchr() as a result. And don't flame me about index and strchr having the same arguments. I've just recently weaned myself off #defining them. I also misspelled "interleave" as "interleaf" in my message. > FLAME ON: Why don't *you* use it? That's what its for! FLAME OFF! [what was the name of the guy in the comix who does this? The human torch?] I don't know why I don't use lint... probably because I've pretty much got all the libraries memorised by now (except for the aforementioned mental block) and this is about the only error that lint catches and the compilers don't anymore. I also do a *lot* of 'C' programming in environments where lint doesn't exist. After you've linted to no avail enough times you get turned off it. When ANSI 'C' function prototypes become widely available lint will go the way of all flesh. PS: I can't quite figure out how strchr could be corrupting the stack. The calling argument does all the pushing and popping, strchr never modifies its arguments, and the size of the arguments is the same either way. If strchr *is* clobbering the stack, that's possibly a bug in strchr. Well, at least a design flaw. -- -- Peter da Silva `-_-' ...!seismo!soma!uhnix1!sugar!peter -- U <--- not a copyrighted cartoon :->