summaryrefslogtreecommitdiff
path: root/usr.bin/tail
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1999-04-29 04:18:44 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1999-04-29 04:18:44 +0000
commitd80ec05eeebd4d70c20bc76bbe6068b89532da46 (patch)
tree4780d94d6e26bf3aa4187e1d96de40b438dbf597 /usr.bin/tail
parent6df474471702def274bdfe8ca46455a46d4db4d4 (diff)
don't step on the tail if there is no one, or core dumps; millert - yes
Diffstat (limited to 'usr.bin/tail')
-rw-r--r--usr.bin/tail/reverse.c7
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)