diff options
-rw-r--r-- | usr.bin/tail/reverse.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/tail/reverse.c b/usr.bin/tail/reverse.c index 13dd65795fc..06c181bf3fa 100644 --- a/usr.bin/tail/reverse.c +++ b/usr.bin/tail/reverse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: reverse.c,v 1.4 1999/02/03 02:09:30 millert Exp $ */ +/* $OpenBSD: reverse.c,v 1.5 1999/04/29 04:18:43 mickey Exp $ */ /* $NetBSD: reverse.c,v 1.6 1994/11/23 07:42:10 jtc Exp $ */ /*- @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)reverse.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: reverse.c,v 1.4 1999/02/03 02:09:30 millert Exp $"; +static char rcsid[] = "$OpenBSD: reverse.c,v 1.5 1999/04/29 04:18:43 mickey Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -199,6 +199,9 @@ r_buf(fp) } else mark->next = mark->prev = (mark = tl); + if (!enomem) + tl->len = 0; + /* Fill the block with input data. */ for (p = tl->l, len = 0; len < BSZ && (ch = getc(fp)) != EOF; ++len) |