Fix crash in Windows platform logging with long lines

This commit is contained in:
GoaLitiuM
2021-02-13 00:46:39 +02:00
parent 8158c94d26
commit ccc60af4b6

View File

@@ -630,12 +630,12 @@ void WindowsPlatform::Exit()
void WindowsPlatform::Log(const StringView& msg)
{
Char buffer[500];
Char buffer[512];
Char* str;
if (msg.Length() + 3 < ARRAY_COUNT(buffer))
str = buffer;
else
str = new Char[msg.Length() + 3];
str = (Char*)Allocate((msg.Length() + 3) * sizeof(Char), 16);
MemoryCopy(str, msg.Get(), msg.Length() * sizeof(Char));
str[msg.Length() + 0] = '\r';
str[msg.Length() + 1] = '\n';