From 8e1e52534042e8f8e746483b787d87a1455bd6f4 Mon Sep 17 00:00:00 2001 From: Suns <52580541+SunsBR@users.noreply.github.com> Date: Sat, 23 May 2020 03:56:30 -0300 Subject: [PATCH] Fix corrupted data in Windows systems (#47) The base64 data from the decoder to the file writer is in binary, using only the "w" flag would work in most unix systems but its incorrect and for all systems with crazy line_feed/Carrier_return or any character conversion the right way to save a binary data is using the "wb" flag. --- skins_updater.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skins_updater.lua b/skins_updater.lua index e349e99..22f3486 100644 --- a/skins_updater.lua +++ b/skins_updater.lua @@ -75,7 +75,7 @@ end -- Insecure workaround since meta/ and textures/ cannot be written to local function unsafe_file_write(path, contents) - local f = ie.io.open(path, "w") + local f = ie.io.open(path, "wb") f:write(contents) f:close() end