Commit c42b1892 authored by Michael R Sweet's avatar Michael R Sweet

Fix an issue with the _mxml_vstrdupf function (STR #107)

parent 6b83ce88
...@@ -8,6 +8,7 @@ CHANGES IN Mini-XML 2.7 ...@@ -8,6 +8,7 @@ CHANGES IN Mini-XML 2.7
- The shared library did not include a destructor for the thread- - The shared library did not include a destructor for the thread-
specific data key on UNIX-based operating systems (STR #103) specific data key on UNIX-based operating systems (STR #103)
- mxmlLoad* did not error out on XML with multiple root nodes (STR #101) - mxmlLoad* did not error out on XML with multiple root nodes (STR #101)
- Fixed an issue with the _mxml_vstrdupf function (STR #107)
CHANGES IN Mini-XML 2.6 CHANGES IN Mini-XML 2.6
......
...@@ -418,9 +418,10 @@ char * /* O - New string pointer */ ...@@ -418,9 +418,10 @@ char * /* O - New string pointer */
_mxml_vstrdupf(const char *format, /* I - Printf-style format string */ _mxml_vstrdupf(const char *format, /* I - Printf-style format string */
va_list ap) /* I - Pointer to additional arguments */ va_list ap) /* I - Pointer to additional arguments */
{ {
int bytes; /* Number of bytes required */ int bytes; /* Number of bytes required */
char *buffer, /* String buffer */ char *buffer, /* String buffer */
temp[256]; /* Small buffer for first vsnprintf */ temp[256]; /* Small buffer for first vsnprintf */
va_list apcopy; /* Copy of argument list */
/* /*
...@@ -428,7 +429,8 @@ _mxml_vstrdupf(const char *format, /* I - Printf-style format string */ ...@@ -428,7 +429,8 @@ _mxml_vstrdupf(const char *format, /* I - Printf-style format string */
* needed... * needed...
*/ */
bytes = vsnprintf(temp, sizeof(temp), format, ap); va_copy(apcopy, ap);
bytes = vsnprintf(temp, sizeof(temp), format, apcopy);
if (bytes < sizeof(temp)) if (bytes < sizeof(temp))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment