mxmlElementSetAttrf did not work with some versions of Visual Studio

(Issue #184)
This commit is contained in:
Michael Sweet 2017-03-29 20:03:46 -04:00
parent 6827e84f17
commit 876e6a9ac8
2 changed files with 9 additions and 1 deletions

View File

@ -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)

View File

@ -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))
{