diff options
Diffstat (limited to 'lbuiltin.c')
-rw-r--r-- | lbuiltin.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbuiltin.c,v 1.102 2000/04/04 20:49:32 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.103 2000/04/13 16:46:43 roberto Exp roberto $ |
3 | ** Built-in functions | 3 | ** Built-in functions |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -166,7 +166,7 @@ void luaB_tonumber (lua_State *L) { | |||
166 | const char *s1 = luaL_check_string(L, 1); | 166 | const char *s1 = luaL_check_string(L, 1); |
167 | char *s2; | 167 | char *s2; |
168 | Number n; | 168 | Number n; |
169 | luaL_arg_check(L, 0 <= base && base <= 36, 2, "base out of range"); | 169 | luaL_arg_check(L, 2 <= base && base <= 36, 2, "base out of range"); |
170 | n = strtoul(s1, &s2, base); | 170 | n = strtoul(s1, &s2, base); |
171 | if (s1 != s2) { /* at least one valid digit? */ | 171 | if (s1 != s2) { /* at least one valid digit? */ |
172 | while (isspace((unsigned char)*s2)) s2++; /* skip trailing spaces */ | 172 | while (isspace((unsigned char)*s2)) s2++; /* skip trailing spaces */ |