#endif
#include <afs/afsutil.h>
+/* C99 requires va_copy. Older versions of GCC provide __va_copy. Per t
+ Autoconf manual, memcpy is a generally portable fallback. */
+#ifndef va_copy
+# ifdef __va_copy
+# define va_copy(d, s) __va_copy((d), (s))
+# else
+# define va_copy(d, s) memcpy(&(d), &(s), sizeof(va_list))
+# endif
+#endif
+
char *bufferPtr;
int bufferLen;
int osi_audit_all = (-1); /* Not determined yet */
bufferPtr += sizeof(vaLong);
break;
case AUD_LST: /* Ptr to another list */
- vaLst = va_arg(vaList, va_list);
+ va_copy(vaLst, vaList);
audmakebuf(audEvent, vaLst);
+ va_end(vaLst);
break;
case AUD_FID: /* AFSFid - contains 3 entries */
vaFid = (struct AFSFid *)va_arg(vaList, struct AFSFid *);
fprintf(out, "LONG %d ", vaLong);
break;
case AUD_LST: /* Ptr to another list */
- vaLst = va_arg(vaList, va_list);
+ va_copy(vaLst, vaList);
printbuf(out, 1, "VALST", 0, vaLst);
+ va_end(vaLst);
break;
case AUD_FID: /* AFSFid - contains 3 entries */
vaFid = va_arg(vaList, struct AFSFid *);