diff options
Diffstat (limited to 'usr.bin/wall/wall.c')
-rw-r--r-- | usr.bin/wall/wall.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/wall/wall.c b/usr.bin/wall/wall.c index 5c44749..eea253f 100644 --- a/usr.bin/wall/wall.c +++ b/usr.bin/wall/wall.c @@ -239,8 +239,9 @@ makemsg(char *fname) err(1, "can't read %s", fname); setegid(egid); } + cnt = 0; while (fgets(lbuf, sizeof(lbuf), stdin)) { - for (cnt = 0, p = lbuf; (ch = *p) != '\0'; ++p, ++cnt) { + for (p = lbuf; (ch = *p) != '\0'; ++p, ++cnt) { if (ch == '\r') { putc('\r', fp); cnt = 0; |