using new 'lua_newuserdatauv' instead of 'lua_newuserdata'

This commit is contained in:
Roberto Ierusalimschy
2018-02-21 10:48:44 -03:00
parent 06865aa01d
commit c67603fafb
3 changed files with 6 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: liolib.c,v 2.153 2017/11/16 13:19:06 roberto Exp roberto $
** $Id: liolib.c,v 2.154 2017/11/16 16:28:36 roberto Exp roberto $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
@@ -186,7 +186,7 @@ static FILE *tofile (lua_State *L) {
** handle is in a consistent state.
*/
static LStream *newprefile (lua_State *L) {
LStream *p = (LStream *)lua_newuserdata(L, sizeof(LStream));
LStream *p = (LStream *)lua_newuserdatauv(L, sizeof(LStream), 0);
p->closef = NULL; /* mark file handle as 'closed' */
luaL_setmetatable(L, LUA_FILEHANDLE);
return p;