NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/58421: awk(1) goes into infinite loop when reading dirs. on tmpfs



The following reply was made to PR bin/58421; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/58421: awk(1) goes into infinite loop when reading dirs. on tmpfs
Date: Fri, 12 Jul 2024 09:43:23 +0700

     Date:        Thu, 11 Jul 2024 23:15:00 +0000 (UTC)
     From:        rvp%SDF.ORG@localhost
     Message-ID:  <20240711231500.DB96F1A923A%mollari.NetBSD.org@localhost>
 
   | +		isrec = (found == 0 && *buf == '\0') ? false : true;
 
 Surely that's just:
 		isrec = !(found == 0 && *buf == '\0');
 or simplified:
 		isrec = found != 0 || *buf != '\0';
 or if you prefer brevity:
 		isrec = found || *buf;
 
 Why bother with the ? : operator in a case like that?
 
 
   | +		isrec = (c == EOF && rr == buf) ? false : true;
 
 And similarly there:
 		isrec = c != EOF || rr != buf;
 
 kre
 


Home | Main Index | Thread Index | Old Index