--- safefmt.c.orig	2005-01-31 05:24:12.000000000 +1100
+++ safefmt.c	2011-09-01 21:18:23.000000000 +1000
@@ -489,10 +489,10 @@ scan_format_string(isafestr_t ifmt, argl
         SET_ARGLIST_TYPE(format_arg, type);
     }
 
-    ap = arglist->ap;
+    va_copy(ap, arglist->ap);
     for (x = arglist->current;  x < max_arg;  x++)
         load_argument(x, arglist);
-    arglist->ap = ap;
+    va_copy(arglist->ap, ap);
 
     arglist->max     = max_arg;
     arglist->scanned = 1;
@@ -675,7 +675,7 @@ parse_format_string(output_fn outfn, voi
     arglist.current = 0;
     arglist.max     = 0;
     arglist.scanned = 0;
-    arglist.ap      = ap;
+    va_copy(arglist.ap, ap);
     memset(arglist.list, 0, sizeof(arglist.list));
 
     cs_d = 0;
@@ -683,7 +683,6 @@ parse_format_string(output_fn outfn, voi
     padding = NULL;
     *nbytes = padding_size = 0;
     arglist.current = arglist.max = arglist.scanned = 0;
-    arglist.ap = ap;
     trusted = (ifmt->hdr.flags & SAFESTR_TRUSTED) == SAFESTR_TRUSTED;
 
     for (c = start = ifmt->str;  c < ifmt->str + ifmt->hdr.length;  start = ++c)
