summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/sdiff/sdiff.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/sdiff/sdiff.c b/usr.bin/sdiff/sdiff.c
index 0c822aa..3a97e10 100644
--- a/usr.bin/sdiff/sdiff.c
+++ b/usr.bin/sdiff/sdiff.c
@@ -514,12 +514,14 @@ istextfile(FILE *f)
if (f == NULL)
return (1);
rewind(f);
- for (i = 0; i <= MAX_CHECK || ch != EOF; i++) {
+ for (i = 0; i <= MAX_CHECK; i++) {
ch = fgetc(f);
if (ch == '\0') {
rewind(f);
return (0);
}
+ if (ch == EOF)
+ break;
}
rewind(f);
return (1);
OpenPOWER on IntegriCloud