Fix a console log crash when color is on the edge.

This commit is contained in:
Unknown W. Brackets 2013-01-31 22:58:16 -08:00
parent ac59efad11
commit d13e08423a

View file

@ -340,7 +340,7 @@ void ConsoleListener::SendToThread(LogTypes::LOG_LEVELS Level, const char *Text)
logWritePos -= LOG_PENDING_MAX;
int start = 0;
if (logWritePos < LOG_PENDING_MAX)
if (logWritePos < LOG_PENDING_MAX && logWritePos + Len >= LOG_PENDING_MAX)
{
const int count = LOG_PENDING_MAX - logWritePos;
memcpy(logPending + logWritePos, Text, count);