Fixed incorrect accumulation of newlines in log.

This commit is contained in:
crs 2004-02-28 16:06:00 +00:00
parent 3dea8f8c5d
commit 9f7e909361
1 changed files with 5 additions and 2 deletions

View File

@ -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);