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:
parent
d9e5246b17
commit
76900889fa
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=104563
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user