diff options
-rw-r--r-- | sbin/dump/optr.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c index 97b74381daef..d039a95078ce 100644 --- a/sbin/dump/optr.c +++ b/sbin/dump/optr.c @@ -227,17 +227,20 @@ void msg(const char *fmt, ...) { va_list ap; + va_list ap2; (void) fprintf(stderr," DUMP: "); #ifdef TDEBUG (void) fprintf(stderr, "pid=%d ", getpid()); #endif va_start(ap, fmt); - (void) vsnprintf(lastmsg, sizeof(lastmsg), fmt, ap); - (void) fprintf(stderr, lastmsg); + va_copy(ap2, ap); + (void) vfprintf(stderr, fmt, ap); (void) fflush(stdout); (void) fflush(stderr); + (void) vsnprintf(lastmsg, sizeof(lastmsg), fmt, ap2); va_end(ap); + va_end(ap2); } void |