From 9f7e909361c4bde75b35235637319e4b8a2a2ee1 Mon Sep 17 00:00:00 2001 From: crs Date: Sat, 28 Feb 2004 16:06:00 +0000 Subject: [PATCH] Fixed incorrect accumulation of newlines in log. --- lib/base/CLog.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/base/CLog.cpp b/lib/base/CLog.cpp index f99d90dd..1cc007da 100644 --- a/lib/base/CLog.cpp +++ b/lib/base/CLog.cpp @@ -265,6 +265,9 @@ CLog::output(int priority, char* msg) const msg[g_maxPriorityLength + 1] = ' '; } + // find end of message + char* end = msg + g_priorityPad + strlen(msg + g_priorityPad); + // write to each outputter CArchMutexLock lock(m_mutex); for (COutputterList::const_iterator index = m_alwaysOutputters.begin(); @@ -274,7 +277,7 @@ CLog::output(int priority, char* msg) const ILogOutputter* outputter = *index; // put an appropriate newline at the end - strcat(msg + g_priorityPad, outputter->getNewline()); + strcpy(end, outputter->getNewline()); // open the outputter outputter->open(kApplication); @@ -289,7 +292,7 @@ CLog::output(int priority, char* msg) const ILogOutputter* outputter = *index; // put an appropriate newline at the end - strcat(msg + g_priorityPad, outputter->getNewline()); + strcpy(end, outputter->getNewline()); // open the outputter outputter->open(kApplication);