diff --git a/CHANGES.md b/CHANGES.md index e87cef8..75ffbaa 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,8 @@ # Changes in Mini-XML 2.11 - Fixed a memory leak in mxmlDelete (Issue #183) +- mxmlElementSetAttrf did not work with some versions of Visual Studio + (Issue #184) - The configure script now properly supports cross-compilation (Issue #188) diff --git a/mxml-string.c b/mxml-string.c index 9cf14e5..a6337b0 100644 --- a/mxml-string.c +++ b/mxml-string.c @@ -474,7 +474,6 @@ _mxml_vstrdupf(const char *format, /* I - Printf-style format string */ int bytes; /* Number of bytes required */ char *buffer, /* String buffer */ temp[256]; /* Small buffer for first vsnprintf */ - va_list apcopy; /* Copy of argument list */ /* @@ -482,8 +481,15 @@ _mxml_vstrdupf(const char *format, /* I - Printf-style format string */ * needed... */ +# ifdef WIN32 + bytes = _vscprintf(format, ap); + +# else + va_list apcopy; /* Copy of argument list */ + va_copy(apcopy, ap); bytes = vsnprintf(temp, sizeof(temp), format, apcopy); +# endif /* WIN32 */ if (bytes < sizeof(temp)) {