2.10.3 unbatch bug and fix

Sam McCall - Hacker In Residency cccsam at ucdavis.UUCP
Fri Mar 21 14:51:31 AEST 1986


>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
>    ekrell at ucla-locus.arpa      ..!{sdcrdcf,ihnp4,trwspp,ucbvax}!ucla-cs!ekrell
> 
>           You have the right to express your opinions,
>           but that doesn't mean your opinions are right !

nope.  (a or b) != (!a and !b), but !(a or b) == (!a and !b).
thus, for the two to have been equal, you would have wanted to see

 		while !(strncmp(buf, "#! rnews ", 9) 
 			|| strncmp(buf, "! rnews ", 8)) { /* kludge for bug */

as the first example.


-- 
-sam mccall
-unix consultant
-computer center
-university of california, davis
-...{lll-crg,ucbvax}!ucdavis!deneb!cccsam
-...ucdavis!deneb!cccsam at ucbvax.berkeley.edu



More information about the Net.bugs mailing list