diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2001-10-06 10:52:26 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2001-10-06 10:52:26 +0000 |
commit | 64313d44483151a96bc3c2f61d09d720279da5c6 (patch) | |
tree | 5107a1a81afd1424d60f40effccb5287051fc063 | |
parent | c02a7c2c361468b54a0dae09c3fb53f5936109d7 (diff) |
This PUTBACK must be protected against EOF. The others are fine.
-rw-r--r-- | usr.bin/m4/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c index 0374cf6f6bb..d9d5503dc26 100644 --- a/usr.bin/m4/main.c +++ b/usr.bin/m4/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.50 2001/09/28 12:05:38 espie Exp $ */ +/* $OpenBSD: main.c,v 1.51 2001/10/06 10:52:25 espie Exp $ */ /* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */ /*- @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: main.c,v 1.50 2001/09/28 12:05:38 espie Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.51 2001/10/06 10:52:25 espie Exp $"; #endif #endif /* not lint */ @@ -519,7 +519,8 @@ inspect(c, tp) while ((isalnum(c = gpbc()) || c == '_') && tp < etp) h = (h << 5) + h + (*tp++ = c); - PUTBACK(c); + if (c != EOF) + PUTBACK(c); *tp = EOS; /* token is too long, it won't match anything, but it can still * be output. */ |