Clean up use of <stdarg.h> macros: always call va_end after va_start,

reset with a call to va_start before each use of the va_list.

Obtained from:	NetBSD
This commit is contained in:
tjr 2002-10-06 11:14:21 +00:00
parent b5f0d0d8f2
commit 91b15ccd4a

View File

@ -926,19 +926,23 @@ run_err(const char *fmt, ...)
{
static FILE *fp;
va_list ap;
va_start(ap, fmt);
++errs;
if (fp == NULL && !(fp = fdopen(rem, "w")))
return;
(void)fprintf(fp, "%c", 0x01);
(void)fprintf(fp, "rcp: ");
va_start(ap, fmt);
(void)vfprintf(fp, fmt, ap);
va_end(ap);
(void)fprintf(fp, "\n");
(void)fflush(fp);
if (!iamremote)
if (!iamremote) {
va_start(ap, fmt);
vwarnx(fmt, ap);
va_end(ap);
}
va_end(ap);
}