summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2001-06-10 11:33:03 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2001-06-10 11:33:03 +0000
commitf39c02bed013cb2cf33666aac201e73e62ba77f7 (patch)
tree84a2f73c21cafff527e2850bd33356a18f910802
parent6b8609f5241a1fb3514302ac094e5a4801ae53fb (diff)
you cannot vfprintf(fp, fmt, ap) twice, from portable, via drahn@
-rw-r--r--usr.bin/ssh/scp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c
index c49fd3e19a4..ad5e55cbfb4 100644
--- a/usr.bin/ssh/scp.c
+++ b/usr.bin/ssh/scp.c
@@ -75,7 +75,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.72 2001/06/03 19:38:42 markus Exp $");
+RCSID("$OpenBSD: scp.c,v 1.73 2001/06/10 11:33:02 markus Exp $");
#include "xmalloc.h"
#include "atomicio.h"
@@ -924,22 +924,24 @@ run_err(const char *fmt,...)
{
static FILE *fp;
va_list ap;
- va_start(ap, fmt);
++errs;
if (fp == NULL && !(fp = fdopen(remout, "w")))
return;
(void) fprintf(fp, "%c", 0x01);
(void) fprintf(fp, "scp: ");
+ va_start(ap, fmt);
(void) vfprintf(fp, fmt, ap);
+ va_end(ap);
(void) fprintf(fp, "\n");
(void) fflush(fp);
if (!iamremote) {
+ va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
+ va_end(ap);
fprintf(stderr, "\n");
}
- va_end(ap);
}
void