This commit is contained in:
Roberto Ierusalimschy
2005-07-31 14:12:32 -03:00
parent 280f7becb8
commit 1a343814d8
2 changed files with 8 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lobject.c,v 2.15 2005/05/31 14:25:18 roberto Exp roberto $
** $Id: lobject.c,v 2.16 2005/07/11 14:00:14 roberto Exp roberto $
** Some generic functions over Lua objects
** See Copyright Notice in lua.h
*/
@@ -89,11 +89,10 @@ int luaO_rawequalObj (const TValue *t1, const TValue *t2) {
int luaO_str2d (const char *s, lua_Number *result) {
char *endptr;
lua_Number res = lua_str2number(s, &endptr);
if (endptr == s) return 0; /* no conversion */
*result = lua_str2number(s, &endptr);
if (endptr == s) return 0; /* conversion failed */
while (isspace(cast(unsigned char, *endptr))) endptr++;
if (*endptr != '\0') return 0; /* invalid trailing characters? */
*result = res;
return 1;
}