diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-22 01:39:33 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-22 01:39:33 +1000 |
commit | f040e09ab79e821314f737bbc652c63cac278a7a (patch) | |
tree | 169760e35c7e5d38d49a0a197c3fb6bff625cf26 /src/lbaselib.js | |
parent | 9a3c95285ffa95eacf586b19b955f9014f4975f0 (diff) | |
download | fengari-f040e09ab79e821314f737bbc652c63cac278a7a.tar.gz fengari-f040e09ab79e821314f737bbc652c63cac278a7a.tar.bz2 fengari-f040e09ab79e821314f737bbc652c63cac278a7a.zip |
lua_stringtonumber is meant to return length + 1
Diffstat (limited to 'src/lbaselib.js')
-rw-r--r-- | src/lbaselib.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lbaselib.js b/src/lbaselib.js index bffe5a6..613adc0 100644 --- a/src/lbaselib.js +++ b/src/lbaselib.js @@ -162,7 +162,7 @@ const luaB_tonumber = function(L) { return 1; } else { let s = lua.lua_tostring(L, 1); - if (s !== null && lua.lua_stringtonumber(L, s) === s.length) + if (s !== null && lua.lua_stringtonumber(L, s) === s.length+1) return 1; /* successful conversion to number */ } } else { |