From cb1ce1416948bea94bd0bb4bb3a66a74cc16557b Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 1 Feb 2012 14:08:12 +0000 Subject: AString logging fix 2 git-svn-id: http://mc-server.googlecode.com/svn/trunk@218 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cLog.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'source/cLog.cpp') diff --git a/source/cLog.cpp b/source/cLog.cpp index b83d3cc37..5a93ddd0f 100644 --- a/source/cLog.cpp +++ b/source/cLog.cpp @@ -69,7 +69,7 @@ void cLog::OpenLog( const char* a_FileName ) #ifdef _WIN32 fopen_s( &m_File, a_FileName, "a+" ); #else - m_File = fopen(a_FileName, "a+" ); + m_File = fopen(a_FileName, "a+" ); #endif } @@ -94,10 +94,18 @@ void cLog::ClearLog() -void cLog::Log(const char* a_Format, va_list argList) +void cLog::Log(const char * a_Format, va_list argList) { AString Message; - AppendVPrintf(Message, a_Format, argList); + if (argList != NULL) + { + AppendVPrintf(Message, a_Format, argList); + } + else + { + // This branch needs to be here because of *nix crashing in vsnprintf() when argList is NULL + Message.assign(a_Format); + } time_t rawtime; time ( &rawtime ); -- cgit v1.2.3