diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-06-13 04:08:04 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-06-13 04:08:04 +0000 |
commit | 3bbcaa9a1fac34a97eb6edba2b758ab6eac67e0b (patch) | |
tree | f04e517b98ea74b7b8fac56fe6434ee41e128b00 /usr.sbin | |
parent | c31dc634cf99d3c66732a6b2ecd3d4c35ff7071b (diff) |
need va_start/end pair every time we call vfprintf(). via markus
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/route6d/route6d.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c index d6aae072c6b..d54bab1e05d 100644 --- a/usr.sbin/route6d/route6d.c +++ b/usr.sbin/route6d/route6d.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route6d.c,v 1.17 2001/03/09 03:24:10 deraadt Exp $ */ +/* $OpenBSD: route6d.c,v 1.18 2001/06/13 04:08:03 itojun Exp $ */ /* $KAME: route6d.c,v 1.60 2001/03/08 02:15:42 onoe Exp $ */ /* @@ -31,7 +31,7 @@ */ #if 0 -static char _rcsid[] = "$OpenBSD: route6d.c,v 1.17 2001/03/09 03:24:10 deraadt Exp $"; +static char _rcsid[] = "$OpenBSD: route6d.c,v 1.18 2001/06/13 04:08:03 itojun Exp $"; #endif #include <stdio.h> @@ -3295,22 +3295,28 @@ tracet(level, fmt, va_alist) { va_list ap; + if (level <= dflag) { #ifdef __STDC__ - va_start(ap, fmt); + va_start(ap, fmt); #else - va_start(ap); + va_start(ap); #endif - if (level <= dflag) { fprintf(stderr, "%s: ", hms()); vfprintf(stderr, fmt, ap); + va_end(ap); } if (dflag) { +#ifdef __STDC__ + va_start(ap, fmt); +#else + va_start(ap); +#endif if (level > 0) vsyslog(LOG_DEBUG, fmt, ap); else vsyslog(LOG_WARNING, fmt, ap); + va_end(ap); } - va_end(ap); } void @@ -3325,20 +3331,27 @@ trace(level, fmt, va_alist) { va_list ap; + if (level <= dflag) { #ifdef __STDC__ - va_start(ap, fmt); + va_start(ap, fmt); #else - va_start(ap); + va_start(ap); #endif - if (level <= dflag) vfprintf(stderr, fmt, ap); + va_end(ap); + } if (dflag) { +#ifdef __STDC__ + va_start(ap, fmt); +#else + va_start(ap); +#endif if (level > 0) vsyslog(LOG_DEBUG, fmt, ap); else vsyslog(LOG_WARNING, fmt, ap); + va_end(ap); } - va_end(ap); } unsigned int |