1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-02-11 22:13:55 +00:00

Fixed console.log to not use AllocA, in case the input string is very long

This commit is contained in:
Bryan Roe
2020-06-22 18:33:44 -07:00
parent 1962100df1
commit 660777406e

View File

@@ -588,8 +588,8 @@ duk_ret_t ILibDuktape_Polyfills_Console_log(duk_context *ctx)
len += 2; // NULL Terminator and final carriage return
strLen = len;
str = ILibMemory_AllocateA(strLen + ((PREFIX != NULL) ? strnlen_s(PREFIX, 9) : 0));
x = (int)(ILibMemory_AllocateA_Size(str) - strLen);
str = Duktape_PushBuffer(ctx, strLen + ((PREFIX != NULL) ? strnlen_s(PREFIX, 9) : 0));
x = (int)(ILibMemory_Size(str) - strLen);
if (x != 0)
{
strLen += sprintf_s(str, strLen, PREFIX);