diff options
Diffstat (limited to 'src/lstrlib.js')
-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); |