From c549d4fe64c48ab645740e6d12c69c91250fad3d Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 1 May 2014 15:18:06 -0300 Subject: 'lua_strtonum' (and 'luaO_str2num') now return string size, instead of receiving it --- lvm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lvm.c') diff --git a/lvm.c b/lvm.c index 3eed5535..026e943d 100644 --- a/lvm.c +++ b/lvm.c @@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 2.203 2014/04/30 16:50:16 roberto Exp roberto $ +** $Id: lvm.c,v 2.204 2014/04/30 19:29:51 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -70,7 +70,7 @@ int luaV_tonumber_ (const TValue *obj, lua_Number *n) { return 1; } else if (ttisstring(obj) && - luaO_str2num(svalue(obj), tsvalue(obj)->len, &v)) { + luaO_str2num(svalue(obj), &v) == tsvalue(obj)->len + 1) { obj = &v; goto again; /* convert result from 'luaO_str2num' to a float */ } @@ -109,8 +109,8 @@ static int tointeger_aux (const TValue *obj, lua_Integer *p, int up) { *p = ivalue(obj); return 1; } - if (ttisstring(obj) && - luaO_str2num(svalue(obj), tsvalue(obj)->len, &v)) { + else if (ttisstring(obj) && + luaO_str2num(svalue(obj), &v) == tsvalue(obj)->len + 1) { obj = &v; goto again; /* convert result from 'luaO_str2num' to an integer */ } -- cgit v1.2.3-55-g6feb