Commit d70b3e59 authored by Alexandre Julliard's avatar Alexandre Julliard

msxml3: Fix incorrect uses of va_list arguments.

parent 155877e4
......@@ -61,29 +61,35 @@ void wineXmlCallbackLog(char const* caller, xmlErrorLevel lvl, char const* msg,
break;
}
if (ap)
do
{
do
{
heap_free(buf);
buf = heap_alloc(len);
needed = vsnprintf(buf, len, msg, ap);
if (needed == -1)
len *= 2;
else if (needed >= len)
len = needed + 1;
else
needed = 0;
}
while (needed);
wine_dbg_log(dbcl, &__wine_dbch_msxml, caller, buf);
heap_free(buf);
buf = heap_alloc(len);
needed = vsnprintf(buf, len, msg, ap);
if (needed == -1)
len *= 2;
else if (needed >= len)
len = needed + 1;
else
needed = 0;
}
else
while (needed);
wine_dbg_log(dbcl, &__wine_dbch_msxml, caller, "%s", buf);
heap_free(buf);
}
void wineXmlCallbackError(char const* caller, xmlErrorPtr err)
{
enum __wine_debug_class dbcl;
switch (err->level)
{
wine_dbg_log(dbcl, &__wine_dbch_msxml, caller, msg);
case XML_ERR_NONE: dbcl = __WINE_DBCL_TRACE; break;
case XML_ERR_WARNING: dbcl = __WINE_DBCL_WARN; break;
default: dbcl = __WINE_DBCL_ERR; break;
}
wine_dbg_log(dbcl, &__wine_dbch_msxml, caller, "%s", err->message);
}
/* Support for loading xml files from a Wine Windows drive */
......
......@@ -209,6 +209,7 @@ extern xmlNodePtr xmldoc_unlink_xmldecl(xmlDocPtr doc);
extern HRESULT XMLElement_create( IUnknown *pUnkOuter, xmlNodePtr node, LPVOID *ppObj, BOOL own );
extern void wineXmlCallbackLog(char const* caller, xmlErrorLevel lvl, char const* msg, va_list ap);
extern void wineXmlCallbackError(char const* caller, xmlErrorPtr err);
#define LIBXML2_LOG_CALLBACK __WINE_PRINTF_ATTR(2,3)
......@@ -221,8 +222,7 @@ extern void wineXmlCallbackLog(char const* caller, xmlErrorLevel lvl, char const
#define LIBXML2_CALLBACK_ERR(caller, msg, ap) \
wineXmlCallbackLog(#caller, XML_ERR_ERROR, msg, ap)
#define LIBXML2_CALLBACK_SERROR(caller, err) \
wineXmlCallbackLog(#caller, err->level, err->message, NULL)
#define LIBXML2_CALLBACK_SERROR(caller, err) wineXmlCallbackError(#caller, err)
extern BOOL is_preserving_whitespace(xmlNodePtr node);
......
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