summaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-05-01 15:18:06 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-05-01 15:18:06 -0300
commitc549d4fe64c48ab645740e6d12c69c91250fad3d (patch)
tree1f98183ee7518f107d5902916468d99d7fce9527 /lvm.c
parentddff6ecf305e6da4f275b473ef6b66811848a3c6 (diff)
downloadlua-c549d4fe64c48ab645740e6d12c69c91250fad3d.tar.gz
lua-c549d4fe64c48ab645740e6d12c69c91250fad3d.tar.bz2
lua-c549d4fe64c48ab645740e6d12c69c91250fad3d.zip
'lua_strtonum' (and 'luaO_str2num') now return string size, instead of
receiving it
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lvm.c b/lvm.c
index 3eed5535..026e943d 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 2.203 2014/04/30 16:50:16 roberto Exp roberto $ 2** $Id: lvm.c,v 2.204 2014/04/30 19:29:51 roberto Exp roberto $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -70,7 +70,7 @@ int luaV_tonumber_ (const TValue *obj, lua_Number *n) {
70 return 1; 70 return 1;
71 } 71 }
72 else if (ttisstring(obj) && 72 else if (ttisstring(obj) &&
73 luaO_str2num(svalue(obj), tsvalue(obj)->len, &v)) { 73 luaO_str2num(svalue(obj), &v) == tsvalue(obj)->len + 1) {
74 obj = &v; 74 obj = &v;
75 goto again; /* convert result from 'luaO_str2num' to a float */ 75 goto again; /* convert result from 'luaO_str2num' to a float */
76 } 76 }
@@ -109,8 +109,8 @@ static int tointeger_aux (const TValue *obj, lua_Integer *p, int up) {
109 *p = ivalue(obj); 109 *p = ivalue(obj);
110 return 1; 110 return 1;
111 } 111 }
112 if (ttisstring(obj) && 112 else if (ttisstring(obj) &&
113 luaO_str2num(svalue(obj), tsvalue(obj)->len, &v)) { 113 luaO_str2num(svalue(obj), &v) == tsvalue(obj)->len + 1) {
114 obj = &v; 114 obj = &v;
115 goto again; /* convert result from 'luaO_str2num' to an integer */ 115 goto again; /* convert result from 'luaO_str2num' to an integer */
116 } 116 }