mxmlElementSetAttrf did not work with some versions of Visual Studio

(Issue #184)
pull/193/head
Michael Sweet 7 years ago
parent 6827e84f17
commit 876e6a9ac8
  1. 2
      CHANGES.md
  2. 8
      mxml-string.c

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

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

Loading…
Cancel
Save