better encapsulation of some types

This commit is contained in:
Roberto Ierusalimschy
2001-02-22 14:15:18 -03:00
parent 191fd35f0a
commit 52ee91dd73
10 changed files with 83 additions and 64 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lbaselib.c,v 1.23 2001/02/09 19:52:24 roberto Exp roberto $
** $Id: lbaselib.c,v 1.24 2001/02/20 18:29:54 roberto Exp roberto $
** Basic library
** See Copyright Notice in lua.h
*/
@@ -100,7 +100,7 @@ static int luaB_tonumber (lua_State *L) {
luaL_arg_check(L, 2 <= base && base <= 36, 2, "base out of range");
n = strtoul(s1, &s2, base);
if (s1 != s2) { /* at least one valid digit? */
while (isspace((unsigned char)*s2)) s2++; /* skip trailing spaces */
while (isspace(uchar(*s2))) s2++; /* skip trailing spaces */
if (*s2 == '\0') { /* no invalid trailing characters? */
lua_pushnumber(L, n);
return 1;