summaryrefslogtreecommitdiff
path: root/src/lstrlib.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-01-06 22:07:24 +1100
committerdaurnimator <quae@daurnimator.com>2018-01-06 22:07:24 +1100
commiteeebda243a875e3f299f52eefa8da4314fee3cb9 (patch)
tree6705b495ece50e71e57bbda2f0714aefd2c16072 /src/lstrlib.js
parentf4172ddb0ab410199786c468efa0fffcda34e2c5 (diff)
downloadfengari-eeebda243a875e3f299f52eefa8da4314fee3cb9.tar.gz
fengari-eeebda243a875e3f299f52eefa8da4314fee3cb9.tar.bz2
fengari-eeebda243a875e3f299f52eefa8da4314fee3cb9.zip
src/lstrlib.js: Pass byte offsets to DataView constructor
Diffstat (limited to 'src/lstrlib.js')
-rw-r--r--src/lstrlib.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lstrlib.js b/src/lstrlib.js
index 362942d..bd26eba 100644
--- a/src/lstrlib.js
+++ b/src/lstrlib.js
@@ -549,7 +549,7 @@ const str_pack = function(L) {
case KOption.Kfloat: { /* floating-point options */
let buff = lauxlib.luaL_prepbuffsize(b, size);
let n = lauxlib.luaL_checknumber(L, arg); /* get argument */
- let dv = new DataView(buff.buffer);
+ let dv = new DataView(buff.buffer, buff.byteOffset, buff.byteLength);
if (size === 4) dv.setFloat32(0, n, h.islittle);
else dv.setFloat64(0, n, h.islittle);
lauxlib.luaL_addsize(b, size);