diff options
author | 2002-10-24 17:13:36 +0000 | |
---|---|---|
committer | 2002-10-24 17:13:36 +0000 | |
commit | f7a2d4ccdefbf855a3e5e8272c7f773ec51f2961 (patch) | |
tree | 19bacd0bd02aebc0a8cc404d2cb705b40007aee5 /lib/libc/stdio/vfprintf.c | |
parent | Add va_copy() as necessary for powerpc, same protections as was added (diff) | |
download | wireguard-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/stdio/vfprintf.c')
-rw-r--r-- | lib/libc/stdio/vfprintf.c | 6 |
1 files changed, 3 insertions, 3 deletions
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); |