$NetBSD: patch-ap,v 1.1 2006/07/06 13:10:27 markd Exp $

--- gettext-tools/lib/vasprintf.c.orig	2006-06-28 23:14:51.332244000 +1200
+++ gettext-tools/lib/vasprintf.c
@@ -40,7 +40,13 @@ int_vasprintf (char **result, const char
   /* Add one to make sure that it is never zero, which might cause malloc
      to return NULL.  */
   size_t total_width = strlen (format) + 1;
-  va_list ap = *args;
+  va_list ap;
+
+#ifdef va_copy
+  va_copy (ap, *args);
+#else
+  ap = *args;
+#endif
 
   while (*p != '\0')
     {
@@ -109,6 +115,9 @@ int_vasprintf (char **result, const char
 	  p++;
 	}
     }
+#ifdef va_copy
+  va_end (ap);
+#endif
 #ifdef TEST
   global_total_width = total_width;
 #endif
