diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-05-05 03:42:50 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-05-05 03:42:50 +0000 |
commit | afb45593a7773914f611f8aedf36ad18262e1c5e (patch) | |
tree | 58e249dc58b9feb793e0b47e2b253941332f6d35 | |
parent | 47949d28d9f7f1613693a8acc010e38cbe43c4ea (diff) |
Localize variables and don't do anything after exit().
OK espie@, moritz@, and jaredy@.
-rw-r--r-- | usr.bin/m4/misc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/m4/misc.c b/usr.bin/m4/misc.c index 4d230bacdce..eca470741d4 100644 --- a/usr.bin/m4/misc.c +++ b/usr.bin/m4/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.36 2006/12/12 21:16:18 jmc Exp $ */ +/* $OpenBSD: misc.c,v 1.37 2007/05/05 03:42:49 ray Exp $ */ /* $NetBSD: misc.c,v 1.6 1995/09/28 05:37:41 tls Exp $ */ /* @@ -263,16 +263,17 @@ extern char *__progname; void m4errx(int eval, const char *fmt, ...) { - va_list ap; - - va_start(ap, fmt); fprintf(stderr, "%s: ", __progname); fprintf(stderr, "%s at line %lu: ", CURRENT_NAME, CURRENT_LINE); - if (fmt != NULL) + if (fmt != NULL) { + va_list ap; + + va_start(ap, fmt); vfprintf(stderr, fmt, ap); + va_end(ap); + } fprintf(stderr, "\n"); exit(eval); - va_end(ap); } /* |