summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authordrahn <drahn@openbsd.org>2002-10-24 17:13:36 +0000
committerdrahn <drahn@openbsd.org>2002-10-24 17:13:36 +0000
commitf7a2d4ccdefbf855a3e5e8272c7f773ec51f2961 (patch)
tree19bacd0bd02aebc0a8cc404d2cb705b40007aee5 /lib/libc
parentAdd va_copy() as necessary for powerpc, same protections as was added (diff)
downloadwireguard-openbsd-f7a2d4ccdefbf855a3e5e8272c7f773ec51f2961.tar.xz
wireguard-openbsd-f7a2d4ccdefbf855a3e5e8272c7f773ec51f2961.zip
Use va_copy() for varargs assignemnt. va_copy() is standard with C99
and gcc3.2 requires this on powerpc.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/auth_subr.c6
-rw-r--r--lib/libc/stdio/vfprintf.c6
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/libc/gen/auth_subr.c b/lib/libc/gen/auth_subr.c
index 6aab2bfcd63..e6faaa09efa 100644
--- a/lib/libc/gen/auth_subr.c
+++ b/lib/libc/gen/auth_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth_subr.c,v 1.17 2002/10/16 19:45:41 millert Exp $ */
+/* $OpenBSD: auth_subr.c,v 1.18 2002/10/24 17:13:36 drahn Exp $ */
/*-
* Copyright (c) 1995,1996,1997 Berkeley Software Design, Inc.
@@ -129,7 +129,9 @@ static va_list nilap;
* Quick one liners that only exist to keep auth_session_t opaque
*/
void auth_setstate(auth_session_t *as, int s){ as->state = s; }
-void auth_set_va_list(auth_session_t *as, va_list ap) { as->ap = ap; }
+void auth_set_va_list(auth_session_t *as, va_list ap) {
+ va_copy(as->ap, ap);
+}
int auth_getstate(auth_session_t *as) { return (as->state); }
struct passwd *auth_getpwd(auth_session_t *as) { return (as->pwd); }
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index 24a9355942b..ac74e253ac9 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: vfprintf.c,v 1.17 2002/02/19 19:39:37 millert Exp $";
+static char *rcsid = "$OpenBSD: vfprintf.c,v 1.18 2002/10/24 17:13:36 drahn Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -304,7 +304,7 @@ vfprintf(fp, fmt0, ap)
fmt = (char *)fmt0;
argtable = NULL;
nextarg = 1;
- orgap = ap;
+ va_copy(orgap, ap);
uio.uio_iov = iovp = iov;
uio.uio_resid = 0;
uio.uio_iovcnt = 0;
@@ -997,7 +997,7 @@ done:
(*argtable) [0] = NULL;
#endif
for (n = 1; n <= tablemax; n++) {
- (*argtable)[n] = ap;
+ va_copy((*argtable)[n], ap);
switch (typetable[n]) {
case T_UNUSED:
(void) va_arg(ap, int);