1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-25 04:33:23 +00:00

Fixed CreateVariable, so if a negative number is specified, it throws an exception, instead of critical exiting

This commit is contained in:
Bryan Roe
2019-03-09 00:44:36 -08:00
parent 37f4a5af3f
commit 8fbb54d79e

View File

@@ -462,7 +462,7 @@ duk_ret_t ILibDuktape_GenericMarshal_CreateVariable(duk_context *ctx)
{
return(ILibDuktape_Error(ctx, "_GenericMarshal.CreateVariable(): Invalid Parameter"));
}
if (size < 0) { return(ILibDuktape_Error(ctx, "Invalid Size: %d ", size)); }
ptr = (char*)ILibMemory_Allocate(size, 0, NULL, NULL);
if (str != NULL)
{