From 5a135f0670c591893190c716fa61b09522e85b43 Mon Sep 17 00:00:00 2001 From: ricksterhd123 Date: Mon, 1 Jun 2020 22:52:21 +0100 Subject: [PATCH 1/2] Ammendment: using from_userstring inside luaZ_fill --- src/lzio.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lzio.js b/src/lzio.js index b9081a7..25085d7 100644 --- a/src/lzio.js +++ b/src/lzio.js @@ -1,5 +1,6 @@ "use strict"; +const { from_userstring } = require("./defs.js"); const { lua_assert } = require("./llimits.js"); class MBuffer { @@ -50,6 +51,7 @@ const luaZ_fill = function(z) { let buff = z.reader(z.L, z.data); if (buff === null) return EOZ; + buff = from_userstring(buff); lua_assert(buff instanceof Uint8Array, "Should only load binary of array of bytes"); let size = buff.length; if (size === 0) From 4816a107620084e451752b470801348c161fd50e Mon Sep 17 00:00:00 2001 From: ricksterhd123 Date: Mon, 1 Jun 2020 22:53:49 +0100 Subject: [PATCH 2/2] #178 added comment for reminding later --- src/lzio.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lzio.js b/src/lzio.js index 25085d7..ad6f2d9 100644 --- a/src/lzio.js +++ b/src/lzio.js @@ -51,6 +51,7 @@ const luaZ_fill = function(z) { let buff = z.reader(z.L, z.data); if (buff === null) return EOZ; + // convert to lua_string buff = from_userstring(buff); lua_assert(buff instanceof Uint8Array, "Should only load binary of array of bytes"); let size = buff.length;