]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
factor: no ferror+fclose
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 1 Jul 2025 18:53:33 +0000 (11:53 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Jul 2025 00:12:40 +0000 (17:12 -0700)
* src/make-prime-list.c (main): Avoid parallel calls
to ferror and fclose.

src/make-prime-list.c

index 2fd10f760c31af48c857de4fbd677aefd59b9e21..fbeac1736eb88b9be36ab8312c10207e0d5a2ee6 100644 (file)
@@ -234,7 +234,7 @@ main (int argc, char **argv)
   free (sieve);
   free (prime_list);
 
-  if (ferror (stdout) + fclose (stdout))
+  if (ferror (stdout) || fclose (stdout))
     {
       fprintf (stderr, "write error: %s\n", strerror (errno));
       return EXIT_FAILURE;