diff options
Diffstat (limited to 'usr.bin/head/head.c')
-rw-r--r-- | usr.bin/head/head.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/head/head.c b/usr.bin/head/head.c index 3c4865b..9c13591 100644 --- a/usr.bin/head/head.c +++ b/usr.bin/head/head.c @@ -113,7 +113,7 @@ head(fp, cnt) { register int ch; - while ((ch = getc(fp)) != EOF && cnt) { + while (cnt && (ch = getc(fp)) != EOF) { if (putchar(ch) == EOF) err(1, "stdout: %s", strerror(errno)); if (ch == '\n') |