[Freeswitch-svn] [commit] r4764 - freeswitch/trunk/src

Freeswitch SVN mikej at freeswitch.org
Sat Mar 24 16:12:41 EDT 2007


Author: mikej
Date: Sat Mar 24 16:12:41 2007
New Revision: 4764

Modified:
   freeswitch/trunk/src/switch_apr.c

Log:
I think this is actually more correct from what I read.

Modified: freeswitch/trunk/src/switch_apr.c
==============================================================================
--- freeswitch/trunk/src/switch_apr.c	(original)
+++ freeswitch/trunk/src/switch_apr.c	Sat Mar 24 16:12:41 2007
@@ -616,8 +616,15 @@
 	char *buf;
 	int len;
 	size_t buflen;
+	va_list ap2;
 
-	len = vsnprintf(NULL, 0, fmt, ap);
+#ifdef _MSC_VER
+	ap2 = ap;
+#else
+	va_copy(ap2, ap);
+#endif
+
+	len = vsnprintf(NULL, 0, fmt, ap2);
 
 	if (len > 0 && (buf = malloc((buflen = (size_t)(len + 1)))) != NULL) {
 		len = vsnprintf(buf, buflen, fmt, ap);
@@ -627,6 +634,7 @@
 		len = -1;
 	}
 
+	va_end(ap2);
 	return len;
 
 #endif



More information about the Freeswitch-svn mailing list