commit b8a550f716e28f19766b4f8873d6bfb418448080 Author: FRIGN <[email protected]> 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
@@ -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;
}
