factor: no ferror+fclose

* src/make-prime-list.c (main): Avoid parallel calls
to ferror and fclose.
This commit is contained in:
Paul Eggert committed 2025-07-09 17:12:40 -07:00
1 parent 86bddb0d53
commit fb20a7d3e4
1 file changed
+1 -1
+1 -1
View 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;