diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2002-10-24 17:13:37 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2002-10-24 17:13:37 +0000 |
commit | 49dde7b2beb50abee3bbd3f3f984f408c2fda0ec (patch) | |
tree | dd0fdb4330ff8bfd1d1022201af07fe4b96f9f74 | |
parent | 5dfe1978df640fe5f7b95133a7fea9c57c6e21cb (diff) |
Use va_copy() for varargs assignemnt. va_copy() is standard with C99
and gcc3.2 requires this on powerpc.
-rw-r--r-- | lib/libc/gen/auth_subr.c | 6 | ||||
-rw-r--r-- | lib/libc/stdio/vfprintf.c | 6 |
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); |