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
This commit is contained in:
Paul Saab 2003-09-21 22:14:49 +00:00
parent be19fdd17e
commit 4036f9e297
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120323

View File

@ -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