diff options
author | daurnimator <quae@daurnimator.com> | 2018-01-06 22:07:24 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2018-01-06 22:07:24 +1100 |
commit | eeebda243a875e3f299f52eefa8da4314fee3cb9 (patch) | |
tree | 6705b495ece50e71e57bbda2f0714aefd2c16072 /src | |
parent | f4172ddb0ab410199786c468efa0fffcda34e2c5 (diff) | |
download | fengari-eeebda243a875e3f299f52eefa8da4314fee3cb9.tar.gz fengari-eeebda243a875e3f299f52eefa8da4314fee3cb9.tar.bz2 fengari-eeebda243a875e3f299f52eefa8da4314fee3cb9.zip |
src/lstrlib.js: Pass byte offsets to DataView constructor
Diffstat (limited to 'src')
-rw-r--r-- | src/lstrlib.js | 2 |
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); |