From 4036f9e297d7e7c0890ca6c2ce68f4e98f984844 Mon Sep 17 00:00:00 2001 From: Paul Saab Date: Sun, 21 Sep 2003 22:14:49 +0000 Subject: [PATCH] revert to version 1.25 and use va_copy to obtain another copy of the variable arguments. version 1.26 incorrectly truncated the message if the buffer was too long. Requested by: bde --- sbin/dump/optr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c index 97b74381dae..d039a95078c 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