diff options
author | 1999-04-29 04:18:43 +0000 | |
---|---|---|
committer | 1999-04-29 04:18:43 +0000 | |
commit | b2424cb6c7c56a76d0edbe700dbb6b8a14235d5c (patch) | |
tree | b2efdc9f6debb35bb40a5db3ae5fc9db97e068a6 | |
parent | Added wdt driver for the Industrial Computer Source PCI-WDT50x watchdog (diff) | |
download | wireguard-openbsd-b2424cb6c7c56a76d0edbe700dbb6b8a14235d5c.tar.xz wireguard-openbsd-b2424cb6c7c56a76d0edbe700dbb6b8a14235d5c.zip |
don't step on the tail if there is no one, or core dumps; millert - yes
-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) |