summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index bb9b96b361..d9be67599f 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1815,7 +1815,13 @@ char *smb_xstrdup(const char *s)
int smb_xvasprintf(char **ptr, const char *format, va_list ap)
{
int n;
- n = vasprintf(ptr, format, ap);
+ va_list ap2;
+#if defined(HAVE_VA_COPY)
+ __va_copy(ap2, ap);
+#else
+ ap2 = ap;
+#endif
+ n = vasprintf(ptr, format, ap2);
if (n == -1 || ! *ptr) {
smb_panic("smb_xvasprintf: out of memory");
}