From 4de93471f896d07227481034c56c5b40fae11670 Mon Sep 17 00:00:00 2001 From: Lee Thomason Date: Tue, 13 Mar 2012 17:33:35 -0700 Subject: [PATCH] Apply a fix from DoDoEnt for 64 bit linux systems where var args would crash --- tinyxml2.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index ff974ec..68b8fa8 100644 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -1523,6 +1523,9 @@ void XMLPrinter::Print( const char* format, ... ) memcpy( p, accumulator.Mem(), len+1 ); #else int len = vsnprintf( 0, 0, format, va ); + // Close out and re-start the va-args + va_end( va ); + va_start( va, format ); char* p = buffer.PushArr( len ) - 1; vsnprintf( p, len+1, format, va ); #endif