summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2001-06-13 20:13:30 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2001-06-13 20:13:30 +0000
commit296d39fd27fb525b540ab674c92dd061b535211d (patch)
tree7edece7e6e5ae162c611d8f3695633c013d78adc
parentb35b225becf434ea14dcf85d59100220221fec3c (diff)
more va_start/end fixes, ok deraadt@
-rw-r--r--libexec/ftpd/ftpd.c11
-rw-r--r--sbin/dump/optr.c10
-rw-r--r--sbin/routed/main.c10
-rw-r--r--usr.sbin/rarpd/rarpd.c20
4 files changed, 38 insertions, 13 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index f4cc78a77dd..a7b828d2608 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpd.c,v 1.98 2001/06/11 15:18:49 mickey Exp $ */
+/* $OpenBSD: ftpd.c,v 1.99 2001/06/13 20:13:29 markus Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
@@ -73,7 +73,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ftpd.c 8.4 (Berkeley) 4/16/94";
#else
-static char rcsid[] = "$OpenBSD: ftpd.c,v 1.98 2001/06/11 15:18:49 mickey Exp $";
+static char rcsid[] = "$OpenBSD: ftpd.c,v 1.99 2001/06/13 20:13:29 markus Exp $";
#endif
#endif /* not lint */
@@ -1879,11 +1879,18 @@ lreply(n, fmt, va_alist)
#endif
(void)printf("%d- ", n);
(void)vprintf(fmt, ap);
+ va_end(ap);
(void)printf("\r\n");
(void)fflush(stdout);
if (debug) {
+#ifdef __STDC__
+ va_start(ap, fmt);
+#else
+ va_start(ap);
+#endif
syslog(LOG_DEBUG, "<--- %d- ", n);
vsyslog(LOG_DEBUG, fmt, ap);
+ va_end(ap);
}
}
diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c
index f8a33ea68df..ab704a3ae52 100644
--- a/sbin/dump/optr.c
+++ b/sbin/dump/optr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: optr.c,v 1.17 2001/01/19 17:57:34 deraadt Exp $ */
+/* $OpenBSD: optr.c,v 1.18 2001/06/13 20:13:28 markus Exp $ */
/* $NetBSD: optr.c,v 1.11 1997/05/27 08:34:36 mrg Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94";
#else
-static char rcsid[] = "$OpenBSD: optr.c,v 1.17 2001/01/19 17:57:34 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: optr.c,v 1.18 2001/06/13 20:13:28 markus Exp $";
#endif
#endif /* not lint */
@@ -254,8 +254,14 @@ msg(fmt, va_alist)
va_start(ap);
#endif
(void) vfprintf(stderr, fmt, ap);
+ va_end(ap);
(void) fflush(stdout);
(void) fflush(stderr);
+#ifdef __STDC__
+ va_start(ap, fmt);
+#else
+ va_start(ap);
+#endif
(void) vsnprintf(lastmsg, sizeof(lastmsg), fmt, ap);
va_end(ap);
}
diff --git a/sbin/routed/main.c b/sbin/routed/main.c
index 36c186409fa..3b590f05da8 100644
--- a/sbin/routed/main.c
+++ b/sbin/routed/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.10 2001/01/19 17:57:42 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.11 2001/06/13 20:13:29 markus Exp $ */
/*
* Copyright (c) 1983, 1988, 1993
@@ -39,7 +39,7 @@ char copyright[] =
#if !defined(lint)
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/5/93";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.10 2001/01/19 17:57:42 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.11 2001/06/13 20:13:29 markus Exp $";
#endif
#include "defs.h"
@@ -812,11 +812,14 @@ msglog(char *p, ...)
va_start(args, p);
vsyslog(LOG_ERR, p, args);
+ va_end(args);
if (ftrace != 0) {
if (ftrace == stdout)
(void)fputs("routed: ", ftrace);
+ va_start(args, p);
(void)vfprintf(ftrace, p, args);
+ va_end(args);
(void)fputc('\n', ftrace);
}
}
@@ -831,9 +834,12 @@ logbad(int dump, char *p, ...)
va_start(args, p);
vsyslog(LOG_ERR, p, args);
+ va_end(args);
(void)fputs("routed: ", stderr);
+ va_start(args, p);
(void)vfprintf(stderr, p, args);
+ va_end(args);
(void)fputs("; giving up\n",stderr);
(void)fflush(stderr);
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c
index 47d8ffaf705..cb22f20441e 100644
--- a/usr.sbin/rarpd/rarpd.c
+++ b/usr.sbin/rarpd/rarpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rarpd.c,v 1.29 2000/04/14 02:52:35 itojun Exp $ */
+/* $OpenBSD: rarpd.c,v 1.30 2001/06/13 20:13:29 markus Exp $ */
/* $NetBSD: rarpd.c,v 1.25 1998/04/23 02:48:33 mrg Exp $ */
/*
@@ -28,7 +28,7 @@ char copyright[] =
#endif /* not lint */
#ifndef lint
-static char rcsid[] = "$OpenBSD: rarpd.c,v 1.29 2000/04/14 02:52:35 itojun Exp $";
+static char rcsid[] = "$OpenBSD: rarpd.c,v 1.30 2001/06/13 20:13:29 markus Exp $";
#endif
@@ -995,19 +995,25 @@ va_dcl
#endif
{
va_list ap;
-#ifdef __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
if (dflag) {
if (fatal)
(void) fprintf(stderr, "rarpd: error: ");
else
(void) fprintf(stderr, "rarpd: warning: ");
+#ifdef __STDC__
+ va_start(ap, fmt);
+#else
+ va_start(ap);
+#endif
(void) vfprintf(stderr, fmt, ap);
+ va_end(ap);
(void) fprintf(stderr, "\n");
}
+#ifdef __STDC__
+ va_start(ap, fmt);
+#else
+ va_start(ap);
+#endif
vsyslog(LOG_ERR, fmt, ap);
va_end(ap);
if (fatal) {