2.10.3 unbatch bug and fix

Daniel R. Levy levy at ttrdc.UUCP
Sat Mar 22 05:10:54 AEST 1986


In article <805 at ttrdc.UUCP>, levy at ttrdc.UUCP (I) wrote:
><Oh oh here it comes.  Watch out boy, it'll chew you up! \
>Oh oh here it comes.  The LINE EATER!  [Line eater]>
>In article <9980 at ucla-cs.ARPA>, ekrell at ucla-cs.UUCP writes:
>>In article <243 at micropro.UUCP> news at 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



More information about the Net.bugs mailing list