lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 2b4bd21585c15a25fdf7dee6ae7a4fc98916112a
parent beff5b078ac3ffce1af983bdad53cb0e664439c6
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Fri,  5 Jul 2013 11:38:50 -0300

'tonumber': base must be a number

Diffstat:
Mlbaselib.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lbaselib.c b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.277 2013/05/16 18:35:57 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.278 2013/07/05 14:35:49 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -87,7 +87,7 @@ static int luaB_tonumber (lua_State *L) { size_t l; const char *s; lua_Integer n; - int base = lua_tointeger(L, 2); + int base = luaL_checkint(L, 2); luaL_checktype(L, 1, LUA_TSTRING); /* before 'luaL_checklstring'! */ s = luaL_checklstring(L, 1, &l); luaL_argcheck(L, 2 <= base && base <= 36, 2, "base out of range");