Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ttrdc.UUCP Path: utzoo!watmath!clyde!cbosgd!ulysses!mhuxr!mhuxn!ihnp4!cuae2!ltuxa!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: net.bugs,net.news.b Subject: Re: 2.10.3 unbatch bug and fix Message-ID: <806@ttrdc.UUCP> Date: Fri, 21-Mar-86 14:10:54 EST Article-I.D.: ttrdc.806 Posted: Fri Mar 21 14:10:54 1986 Date-Received: Sat, 22-Mar-86 22:44:58 EST References: <243@micropro.UUCP> <9980@ucla-cs.ARPA> <805@ttrdc.UUCP> Organization: AT&T, Computer Systems Division, Skokie, IL Lines: 40 Xref: watmath net.bugs:761 net.news.b:1330 In article <805@ttrdc.UUCP>, levy@ttrdc.UUCP (I) wrote: >Oh oh here it comes. The LINE EATER! [Line eater]> >In article <9980@ucla-cs.ARPA>, ekrell@ucla-cs.UUCP writes: >>In article <243@micropro.UUCP> news@micropro.UUCP (USENET administrator) writes: >>>< while (strncmp(buf, "#! rnews ", 9) >>>< || strncmp(buf, "! rnews ", 8)) { /* kludge for bug */ >>>--- >>>> while (!strncmp(buf, "#! rnews ", 9) >>>> && !strncmp(buf, "! rnews ", 8)) { /* kludge for bug */ >> >>Aren't these two the same by De Morgan's law? >>-- >> Eduardo Krell UCLA Computer Science Department >int A,B; > >(A || B) == !(!A && !B); /* sez demorgans law */ > A > 0 1 0 1 > \_____ \_____ >B 0|0|1| 0|1|0| > ----- == ! ----- (Karnaugh map representation) > 1|1|1| 1|0|0| > ----- ----- Sheesh, egg on my face. Not because this logical assertion is untrue (it still holds) but because I just realized that the strncmp clauses above don't make sense! The first will always be true, the second always false. In the first case, there will always be NO MATCH either between buf and "!# rnews " or buf and "! rnews ". NO MATCH means a "boolean" true (nonzero) in strncmp, at least the last time I checked the manual. The OR of two things, at least one of which is guaranteed to be true, is therefore itself guaranteed to be true. Or am I washed up? -- ------------------------------- Disclaimer: The views contained herein are | dan levy | yvel nad | my own and are not at all those of my em- | an engihacker @ | ployer or the administrator of any computer | at&t computer systems division | upon which I may hack. | skokie, illinois | -------------------------------- Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa, vax135}!ttrdc!levy