aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-03-23 13:38:43 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-03-23 13:38:43 -0300
commit29a13b4128caccca1c7796a1252cb04d4e8a0569 (patch)
tree68aa1de39d47a40858fbad6693b004a6500167a6 /lauxlib.c
parentef8c0d7d904a40840d34e758007ae07ca87922d0 (diff)
downloadlua-29a13b4128caccca1c7796a1252cb04d4e8a0569.tar.gz
lua-29a13b4128caccca1c7796a1252cb04d4e8a0569.tar.bz2
lua-29a13b4128caccca1c7796a1252cb04d4e8a0569.zip
detail
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lauxlib.c b/lauxlib.c
index b1d5527b..e80fa157 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.108 2003/11/05 11:59:14 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.109 2004/02/18 13:40:03 roberto Exp roberto $
3** Auxiliary functions for building Lua libraries 3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -267,8 +267,7 @@ LUALIB_API void luaL_openlib (lua_State *L, const char *libname,
267*/ 267*/
268 268
269static int checkint (lua_State *L, int topop) { 269static int checkint (lua_State *L, int topop) {
270 int n = (int)lua_tointeger(L, -1); 270 int n = (lua_type(L, -1) == LUA_TNUMBER) ? lua_tointeger(L, -1) : -1;
271 if (n == 0 && !lua_isnumber(L, -1)) n = -1;
272 lua_pop(L, topop); 271 lua_pop(L, topop);
273 return n; 272 return n;
274} 273}