diff options
author | tjr <tjr@FreeBSD.org> | 2002-10-06 11:14:21 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-10-06 11:14:21 +0000 |
commit | 91b15ccd4acb7520fc9933934b9afb7393bb7c2c (patch) | |
tree | fbde434297a039063e83973159cfcf63fb88f1bd /bin/rcp/rcp.c | |
parent | b5f0d0d8f20813c2d455d7c7558ba9f1262f14df (diff) | |
download | FreeBSD-src-91b15ccd4acb7520fc9933934b9afb7393bb7c2c.zip FreeBSD-src-91b15ccd4acb7520fc9933934b9afb7393bb7c2c.tar.gz |
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
Diffstat (limited to 'bin/rcp/rcp.c')
-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); } |