using new 'lua_newuserdatauv' instead of 'lua_newuserdata'
This commit is contained in:
4
liolib.c
4
liolib.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user