summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-22 14:02:53 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-22 14:02:53 -0200
commit577ae944e9415032410da56e648b7535620b61f5 (patch)
tree89f5fa12ebc7e5121067351d9844c77ed72d8e89
parent68d1091b7996d4e1b40fe43f4bcae2e7594ab806 (diff)
downloadlua-github-577ae944e9415032410da56e648b7535620b61f5.tar.gz
correction of function tonumber
-rw-r--r--opcode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/opcode.c b/opcode.c
index 0e8a8598..a8de7f13 100644
--- a/opcode.c
+++ b/opcode.c
@@ -3,7 +3,7 @@
** TecCGraf - PUC-Rio
*/
-char *rcs_opcode="$Id: opcode.c,v 3.19 1994/11/21 13:30:15 roberto Exp $";
+char *rcs_opcode="$Id: opcode.c,v 3.20 1994/11/21 18:22:58 roberto Exp roberto $";
#include <setjmp.h>
#include <stdio.h>
@@ -138,9 +138,10 @@ static char *lua_strconc (char *l, char *r)
static int lua_tonumber (Object *obj)
{
float t;
+ char c;
if (tag(obj) != LUA_T_STRING)
return 1;
- else if (sscanf(svalue(obj), "%f %*c",&t) == 1)
+ else if (sscanf(svalue(obj), "%f %c",&t, &c) == 1)
{
nvalue(obj) = t;
tag(obj) = LUA_T_NUMBER;