From 03d8a9bf0d8d9c149c0c2c0ae63732a8bfa512fd Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 9 Feb 2001 18:29:33 -0200 Subject: details --- ltests.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index 7eb03939..4aa95d00 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 1.65 2001/02/09 19:53:16 roberto Exp roberto $ +** $Id: ltests.c,v 1.66 2001/02/09 20:22:29 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -356,7 +356,9 @@ static int newuserdata (lua_State *L) { return 2; } else { - lua_newuserdata(L, luaL_check_int(L, 1)); + size_t size = luaL_check_int(L, 1); + char *p = (char *)lua_newuserdata(L, size); + while (size--) *p++ = '\0'; return 1; } } -- cgit v1.2.3-55-g6feb