summaryrefslogtreecommitdiff
path: root/iolib.c
diff options
context:
space:
mode:
Diffstat (limited to 'iolib.c')
-rw-r--r--iolib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/iolib.c b/iolib.c
index d367097e..e518df1b 100644
--- a/iolib.c
+++ b/iolib.c
@@ -41,7 +41,7 @@ static void pushresult (int i)
41static FILE *getfile (char *name) 41static FILE *getfile (char *name)
42{ 42{
43 lua_Object f = lua_getglobal(name); 43 lua_Object f = lua_getglobal(name);
44 if (lua_tag(f) != lua_tagio) 44 if (!lua_isuserdata(f) || lua_tag(f) != lua_tagio)
45 luaL_verror("global variable %s is not a file handle", name); 45 luaL_verror("global variable %s is not a file handle", name);
46 return lua_getuserdata(f); 46 return lua_getuserdata(f);
47} 47}