summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2004-01-08 04:07:55 +0000
committerBrad Smith <brad@cvs.openbsd.org>2004-01-08 04:07:55 +0000
commitd1b89006acbf6a80c2f1acbde2524d27d5a5ec50 (patch)
treed1d0225060b84577dd8633f34c86f5cc8d15dad3 /lib/libc
parent6026ece1b9600e9caf1067f49ff63904b47830de (diff)
use va_copy() with gcc 3 and up.
ok millert@ espie@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/auth_subr.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libc/gen/auth_subr.c b/lib/libc/gen/auth_subr.c
index 01953267aad..d935985792b 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.23 2003/06/11 21:03:10 deraadt Exp $ */
+/* $OpenBSD: auth_subr.c,v 1.24 2004/01/08 04:07:54 brad Exp $ */
/*-
* Copyright (c) 1995,1996,1997 Berkeley Software Design, Inc.
@@ -129,7 +129,13 @@ 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) {
+#if defined(__GNUC__) && __GNUC__ >= 3
+ va_copy(as->ap, ap);
+#else
+ as->ap = ap;
+#endif
+}
int auth_getstate(auth_session_t *as) { return (as->state); }
struct passwd *auth_getpwd(auth_session_t *as) { return (as->pwd); }