From ab421423b9cf4ea5266ba7d8ff582124348976e8 Mon Sep 17 00:00:00 2001 From: ps Date: Sun, 21 Sep 2003 22:14:49 +0000 Subject: 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(-) (limited to 'sbin/dump') diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c index 97b7438..d039a95 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 -- cgit v1.1