diff options
-rw-r--r-- | bin/rcp/rcp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c index d86fec0..8ea6be5 100644 --- a/bin/rcp/rcp.c +++ b/bin/rcp/rcp.c @@ -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); } |