summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-01-06 22:07:51 +1100
committerdaurnimator <quae@daurnimator.com>2018-01-06 22:07:51 +1100
commiteae1d1afb8108d8c642621ffd21f228779a1d792 (patch)
tree477bada3bf382051fecfe6334f9eaac1b4ba9411
parenteeebda243a875e3f299f52eefa8da4314fee3cb9 (diff)
downloadfengari-eae1d1afb8108d8c642621ffd21f228779a1d792.tar.gz
fengari-eae1d1afb8108d8c642621ffd21f228779a1d792.tar.bz2
fengari-eae1d1afb8108d8c642621ffd21f228779a1d792.zip
src/ltablib.js: Pass length to luaL_addlstring
-rw-r--r--src/ltablib.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ltablib.js b/src/ltablib.js
index 70ff595..9998f3c 100644
--- a/src/ltablib.js
+++ b/src/ltablib.js
@@ -131,6 +131,7 @@ const tmove = function(L) {
const tconcat = function(L) {
let last = aux_getn(L, 1, TAB_R);
let sep = lauxlib.luaL_optlstring(L, 2, lua.to_luastring(""));
+ let lsep = sep.length;
let i = lauxlib.luaL_optinteger(L, 3, 1);
last = lauxlib.luaL_optinteger(L, 4, last);
@@ -139,7 +140,7 @@ const tconcat = function(L) {
for (; i < last; i++) {
addfield(L, b, i);
- lauxlib.luaL_addlstring(b, sep);
+ lauxlib.luaL_addlstring(b, sep, lsep);
}
if (i === last)