diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-01 15:08:12 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-01 15:08:12 +0100 |
commit | cb1ce1416948bea94bd0bb4bb3a66a74cc16557b (patch) | |
tree | 9809332db528931f427a3ca6f46d46f561a644be /source/cLog.cpp | |
parent | AString logging fix (diff) | |
download | cuberite-cb1ce1416948bea94bd0bb4bb3a66a74cc16557b.tar cuberite-cb1ce1416948bea94bd0bb4bb3a66a74cc16557b.tar.gz cuberite-cb1ce1416948bea94bd0bb4bb3a66a74cc16557b.tar.bz2 cuberite-cb1ce1416948bea94bd0bb4bb3a66a74cc16557b.tar.lz cuberite-cb1ce1416948bea94bd0bb4bb3a66a74cc16557b.tar.xz cuberite-cb1ce1416948bea94bd0bb4bb3a66a74cc16557b.tar.zst cuberite-cb1ce1416948bea94bd0bb4bb3a66a74cc16557b.zip |
Diffstat (limited to 'source/cLog.cpp')
-rw-r--r-- | source/cLog.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
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 );
|