diff options
Diffstat (limited to 'lbaselib.c')
-rw-r--r-- | lbaselib.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -68,7 +68,6 @@ static const char *b_str2int (const char *s, int base, lua_Integer *pn) { | |||
68 | 68 | ||
69 | static int luaB_tonumber (lua_State *L) { | 69 | static int luaB_tonumber (lua_State *L) { |
70 | if (lua_isnoneornil(L, 2)) { /* standard conversion? */ | 70 | if (lua_isnoneornil(L, 2)) { /* standard conversion? */ |
71 | luaL_checkany(L, 1); | ||
72 | if (lua_type(L, 1) == LUA_TNUMBER) { /* already a number? */ | 71 | if (lua_type(L, 1) == LUA_TNUMBER) { /* already a number? */ |
73 | lua_settop(L, 1); /* yes; return it */ | 72 | lua_settop(L, 1); /* yes; return it */ |
74 | return 1; | 73 | return 1; |
@@ -79,6 +78,7 @@ static int luaB_tonumber (lua_State *L) { | |||
79 | if (s != NULL && lua_stringtonumber(L, s) == l + 1) | 78 | if (s != NULL && lua_stringtonumber(L, s) == l + 1) |
80 | return 1; /* successful conversion to number */ | 79 | return 1; /* successful conversion to number */ |
81 | /* else not a number */ | 80 | /* else not a number */ |
81 | luaL_checkany(L, 1); /* (but there must be some parameter) */ | ||
82 | } | 82 | } |
83 | } | 83 | } |
84 | else { | 84 | else { |