mirror of
https://github.com/minetest-mods/skinsdb.git
synced 2024-12-26 01:00:20 +01:00
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.
This commit is contained in:
parent
af8212a1bd
commit
8e1e525340
@ -75,7 +75,7 @@ end
|
|||||||
|
|
||||||
-- Insecure workaround since meta/ and textures/ cannot be written to
|
-- Insecure workaround since meta/ and textures/ cannot be written to
|
||||||
local function unsafe_file_write(path, contents)
|
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:write(contents)
|
||||||
f:close()
|
f:close()
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user