summaryrefslogtreecommitdiffstats
path: root/src/Log.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-02 21:10:23 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-02 21:10:23 +0100
commit6ef5c057aa2a36dbd54f56780e5700e753b37bcf (patch)
tree5af1787afe89de7b2221330332fbae63b1c30a30 /src/Log.cpp
parentRevert "Added a comment" (diff)
downloadcuberite-6ef5c057aa2a36dbd54f56780e5700e753b37bcf.tar
cuberite-6ef5c057aa2a36dbd54f56780e5700e753b37bcf.tar.gz
cuberite-6ef5c057aa2a36dbd54f56780e5700e753b37bcf.tar.bz2
cuberite-6ef5c057aa2a36dbd54f56780e5700e753b37bcf.tar.lz
cuberite-6ef5c057aa2a36dbd54f56780e5700e753b37bcf.tar.xz
cuberite-6ef5c057aa2a36dbd54f56780e5700e753b37bcf.tar.zst
cuberite-6ef5c057aa2a36dbd54f56780e5700e753b37bcf.zip
Diffstat (limited to 'src/Log.cpp')
-rw-r--r--src/Log.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/Log.cpp b/src/Log.cpp
index 37f1376db..a23a79ccc 100644
--- a/src/Log.cpp
+++ b/src/Log.cpp
@@ -134,15 +134,14 @@ void cLog::Log(const char * a_Format, va_list argList, bool a_ReplaceCurrentLine
__android_log_print(ANDROID_LOG_ERROR, "MCServer", "%s", Line.c_str() );
//CallJavaFunction_Void_String(g_JavaThread, "AddToLog", Line );
#else
- size_t LineLength = Line.length();
-
- if (m_LastStringSize == 0)
- m_LastStringSize = LineLength;
-
if (a_ReplaceCurrentLine)
{
#ifdef _WIN32
- if (LineLength < m_LastStringSize) // If last printed line was longer than current, clear this line
+ if (m_LastStringSize == 0)
+ {
+ m_LastStringSize = Line.length();
+ }
+ else if (Line.length() < m_LastStringSize) // If last printed line was longer than current, clear this line
{
for (size_t X = 0; X != m_LastStringSize; ++X)
{
@@ -163,9 +162,6 @@ void cLog::Log(const char * a_Format, va_list argList, bool a_ReplaceCurrentLine
{
printf("%s", Line.c_str());
}
-
- m_LastStringSize = LineLength;
-
#endif
#if defined (_WIN32) && defined(_DEBUG)