diff options
author | madmaxoft <github@xoft.cz> | 2014-02-27 15:17:42 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-02-27 15:17:42 +0100 |
commit | a23b5d13bde0742e6208bcc75807a97c1c12f7e1 (patch) | |
tree | 3702923f41c77ceacfccc2e596618490409ef16d | |
parent | Fixed crash and some warnings in map handling. (diff) | |
download | cuberite-a23b5d13bde0742e6208bcc75807a97c1c12f7e1.tar cuberite-a23b5d13bde0742e6208bcc75807a97c1c12f7e1.tar.gz cuberite-a23b5d13bde0742e6208bcc75807a97c1c12f7e1.tar.bz2 cuberite-a23b5d13bde0742e6208bcc75807a97c1c12f7e1.tar.lz cuberite-a23b5d13bde0742e6208bcc75807a97c1c12f7e1.tar.xz cuberite-a23b5d13bde0742e6208bcc75807a97c1c12f7e1.tar.zst cuberite-a23b5d13bde0742e6208bcc75807a97c1c12f7e1.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Log.cpp | 4 | ||||
-rw-r--r-- | src/main.cpp | 27 |
2 files changed, 18 insertions, 13 deletions
diff --git a/src/Log.cpp b/src/Log.cpp index 2d6be0f59..1ea327d5d 100644 --- a/src/Log.cpp +++ b/src/Log.cpp @@ -42,7 +42,7 @@ cLog::~cLog() -cLog* cLog::GetInstance() +cLog * cLog::GetInstance() { if (s_Log != NULL) { @@ -92,7 +92,7 @@ void cLog::ClearLog() if( m_File ) fclose (m_File); #endif - m_File = 0; + m_File = NULL; } diff --git a/src/main.cpp b/src/main.cpp index 4d2801926..2ae8a413b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -243,31 +243,36 @@ int main( int argc, char **argv ) // Check if comm logging is to be enabled: for (int i = 0; i < argc; i++) { + AString Arg(argv[i]); if ( - (NoCaseCompare(argv[i], "/commlog") == 0) || - (NoCaseCompare(argv[i], "/logcomm") == 0) + (NoCaseCompare(Arg, "/commlog") == 0) || + (NoCaseCompare(Arg, "/logcomm") == 0) ) { g_ShouldLogCommIn = true; g_ShouldLogCommOut = true; } - if ( - (NoCaseCompare(argv[i], "/commlogin") == 0) || - (NoCaseCompare(argv[i], "/comminlog") == 0) || - (NoCaseCompare(argv[i], "/logcommin") == 0) + else if ( + (NoCaseCompare(Arg, "/commlogin") == 0) || + (NoCaseCompare(Arg, "/comminlog") == 0) || + (NoCaseCompare(Arg, "/logcommin") == 0) ) { g_ShouldLogCommIn = true; } - if ( - (NoCaseCompare(argv[i], "/commlogout") == 0) || - (NoCaseCompare(argv[i], "/commoutlog") == 0) || - (NoCaseCompare(argv[i], "/logcommout") == 0) + else if ( + (NoCaseCompare(Arg, "/commlogout") == 0) || + (NoCaseCompare(Arg, "/commoutlog") == 0) || + (NoCaseCompare(Arg, "/logcommout") == 0) ) { g_ShouldLogCommOut = true; } - } + else if (NoCaseCompare(Arg, "nooutbuf") == 0) + { + setvbuf(stdout, NULL, _IONBF, 0); + } + } // for i - argv[] #if !defined(ANDROID_NDK) try |