1
0
forked from 0ad/0ad

Avoid some potential crashes

This was SVN commit r716.
This commit is contained in:
Ykkrosh 2004-07-12 12:25:27 +00:00
parent ca5b760310
commit 4b87f4bbca
2 changed files with 4 additions and 4 deletions

View File

@ -58,7 +58,7 @@ private:
bool IsFull(void) {return (m_iBufferLength == BUFFER_SIZE);};
bool IsEmpty(void) {return (m_iBufferLength == 0);};
void InsertBuffer(void){InsertMessage(m_szBuffer);};
void InsertBuffer(void){InsertMessage(L"%ls", m_szBuffer);};
void ProcessBuffer(const wchar_t* szLine);
public:

View File

@ -89,7 +89,7 @@ CLogger::~CLogger ()
void CLogger::WriteMessage(const char *message)
{
#ifdef CONSOLE_DEBUG
g_Console->InsertMessage(L"LOG: %hs", message);
if (g_Console) g_Console->InsertMessage(L"LOG: %hs", message);
#endif
m_NumberOfMessages++;
m_MainLog << "<P>" << message << "</P>";
@ -101,7 +101,7 @@ void CLogger::WriteMessage(const char *message)
void CLogger::WriteError(const char *message)
{
#ifdef CONSOLE_DEBUG
g_Console->InsertMessage(L"ERROR: %hs", message);
if (g_Console) g_Console->InsertMessage(L"ERROR: %hs", message);
#endif
debug_out("ERROR: %s\n", message);
m_NumberOfErrors++;
@ -112,7 +112,7 @@ void CLogger::WriteError(const char *message)
void CLogger::WriteWarning(const char *message)
{
#ifdef CONSOLE_DEBUG
g_Console->InsertMessage(L"WARNING: %hs", message);
if (g_Console) g_Console->InsertMessage(L"WARNING: %hs", message);
#endif
m_NumberOfWarnings++;
m_MainLog << "<P class=\"warning\">WARNING: "<< message << "</P>\n";