[hackers] [sbase] No need to check for stdin on fclose() || FRIGN

From: <git_AT_suckless.org>
Date: Sat, 7 Feb 2015 22:54:33 +0100 (CET)

commit b8a550f716e28f19766b4f8873d6bfb418448080
Author: FRIGN <dev_AT_frign.de>
Date: Sat Feb 7 21:42:41 2015 +0100

    No need to check for stdin on fclose()
    
    as we are not trying to read from it afterwards.

diff --git a/cmp.c b/cmp.c
index b6ff20b..bca4c0f 100644
--- a/cmp.c
+++ b/cmp.c
_AT_@ -76,10 +76,8 @@ main(int argc, char *argv[])
                         same = 0;
                 }
         }
-
- for (n = 1; n < 2; n++)
- if (fp[n] != stdin)
- fclose(fp[n]);
+ fclose(fp[0]);
+ fclose(fp[1]);
 
         return same ? Same : Diff;
 }
Received on Sat Feb 07 2015 - 22:54:33 CET

This archive was generated by hypermail 2.3.0 : Sat Feb 07 2015 - 23:00:15 CET