reset slice data memory at creation

This commit is contained in:
DanyLE 2023-01-26 09:00:20 +01:00
parent f4dde9202f
commit 356b96dfcc

View File

@ -53,7 +53,7 @@ void lua_new_slice(lua_State*L, int n)
a->magic = lua_slice_magic(); a->magic = lua_slice_magic();
luaL_getmetatable(L, SLICE); luaL_getmetatable(L, SLICE);
lua_setmetatable(L, -2); lua_setmetatable(L, -2);
(void)memset(a->data,0,n);
a->len = n; a->len = n;
} }
slice_t * lua_check_slice(lua_State *L, int idx) slice_t * lua_check_slice(lua_State *L, int idx)