Commit 31505eb3 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Fixed potential crash caused by overloading the variadic warn function

parent ac813134
...@@ -172,7 +172,7 @@ void warn(const char *file,int line,const char *fmt, ...) ...@@ -172,7 +172,7 @@ void warn(const char *file,int line,const char *fmt, ...)
va_end(args); va_end(args);
} }
void warn(const char *file,int line,const char *fmt,va_list args) void va_warn(const char *file,int line,const char *fmt,va_list args)
{ {
do_warn("WARNINGS", file, line, warning_str, fmt, args); do_warn("WARNINGS", file, line, warning_str, fmt, args);
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
extern void msg(const char *fmt, ...); extern void msg(const char *fmt, ...);
extern void warn(const char *file,int line,const char *fmt, ...); extern void warn(const char *file,int line,const char *fmt, ...);
extern void warn(const char *file,int line,const char *fmt, va_list args); extern void va_warn(const char *file,int line,const char *fmt, va_list args);
extern void warn_simple(const char *file,int line,const char *text); extern void warn_simple(const char *file,int line,const char *text);
extern void warn_undoc(const char *file,int line,const char *fmt, ...); extern void warn_undoc(const char *file,int line,const char *fmt, ...);
extern void warn_doc_error(const char *file,int line,const char *fmt, ...); extern void warn_doc_error(const char *file,int line,const char *fmt, ...);
......
...@@ -1713,7 +1713,7 @@ void TemplateContextImpl::warn(const char *fileName,int line,const char *fmt,... ...@@ -1713,7 +1713,7 @@ void TemplateContextImpl::warn(const char *fileName,int line,const char *fmt,...
{ {
va_list args; va_list args;
va_start(args,fmt); va_start(args,fmt);
::warn(fileName,line,fmt,args); va_warn(fileName,line,fmt,args);
va_end(args); va_end(args);
m_engine->printIncludeContext(fileName,line); m_engine->printIncludeContext(fileName,line);
} }
...@@ -3342,7 +3342,7 @@ void TemplateParser::warn(const char *fileName,int line,const char *fmt,...) con ...@@ -3342,7 +3342,7 @@ void TemplateParser::warn(const char *fileName,int line,const char *fmt,...) con
{ {
va_list args; va_list args;
va_start(args,fmt); va_start(args,fmt);
::warn(fileName,line,fmt,args); va_warn(fileName,line,fmt,args);
va_end(args); va_end(args);
m_engine->printIncludeContext(fileName,line); m_engine->printIncludeContext(fileName,line);
} }
......
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