forked from 0ad/0ad
Prevent ugly output from logger when vswprintf fails before filling the buffer (triggered by Unicode characters on OS X).
This was SVN commit r7704.
This commit is contained in:
parent
a46612d51e
commit
b539188810
@ -215,7 +215,7 @@ void CLogger::LogUsingMethod(ELogMethod method, const wchar_t* message)
|
||||
void CLogger::Log(ELogMethod method, const wchar_t* UNUSED(category), const wchar_t* fmt, ...)
|
||||
{
|
||||
va_list argp;
|
||||
wchar_t buffer[512];
|
||||
wchar_t buffer[512] = {0};
|
||||
|
||||
va_start(argp, fmt);
|
||||
if (sys_vswprintf(buffer, ARRAY_SIZE(buffer), fmt, argp) == -1)
|
||||
@ -232,7 +232,7 @@ void CLogger::Log(ELogMethod method, const wchar_t* UNUSED(category), const wcha
|
||||
void CLogger::LogOnce(ELogMethod method, const wchar_t* UNUSED(category), const wchar_t* fmt, ...)
|
||||
{
|
||||
va_list argp;
|
||||
wchar_t buffer[512];
|
||||
wchar_t buffer[512] = {0};
|
||||
|
||||
va_start(argp, fmt);
|
||||
if (sys_vswprintf(buffer, ARRAY_SIZE(buffer), fmt, argp) == -1)
|
||||
@ -256,7 +256,7 @@ void CLogger::LogOnce(ELogMethod method, const wchar_t* UNUSED(category), const
|
||||
void CLogger::LogMessage(const wchar_t* fmt, ...)
|
||||
{
|
||||
va_list argp;
|
||||
wchar_t buffer[512];
|
||||
wchar_t buffer[512] = {0};
|
||||
|
||||
va_start(argp, fmt);
|
||||
if (sys_vswprintf(buffer, ARRAY_SIZE(buffer), fmt, argp) == -1)
|
||||
@ -272,7 +272,7 @@ void CLogger::LogMessage(const wchar_t* fmt, ...)
|
||||
void CLogger::LogWarning(const wchar_t* fmt, ...)
|
||||
{
|
||||
va_list argp;
|
||||
wchar_t buffer[512];
|
||||
wchar_t buffer[512] = {0};
|
||||
|
||||
va_start(argp, fmt);
|
||||
if (sys_vswprintf(buffer, ARRAY_SIZE(buffer), fmt, argp) == -1)
|
||||
@ -288,7 +288,7 @@ void CLogger::LogWarning(const wchar_t* fmt, ...)
|
||||
void CLogger::LogError(const wchar_t* fmt, ...)
|
||||
{
|
||||
va_list argp;
|
||||
wchar_t buffer[512];
|
||||
wchar_t buffer[512] = {0};
|
||||
|
||||
va_start(argp, fmt);
|
||||
if (sys_vswprintf(buffer, ARRAY_SIZE(buffer), fmt, argp) == -1)
|
||||
|
Loading…
Reference in New Issue
Block a user