1
0
mirror of https://github.com/Adorable-Catgirl/Zorya-NEO.git synced 2024-12-23 09:28:07 +11:00

Use assert instead of print.

This commit is contained in:
Adorable-Catgirl 2020-03-23 15:50:55 -04:00 committed by GitHub
parent 376ccc11a3
commit 782c99df08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,14 +118,13 @@ local function read_header(dat)
end
local ent = {}
ent.magic, ent.namesize, ent.mode, ent.uid, ent.gid, ent.filesize, ent.mtime = string.unpack(e..header_fmt, dat)
return ent, ""
return ent
end
local lname = ""
while lname ~= "TRAILER!!!" do
local dat = read(22)
local e,r = read_header(dat)
if r ~= "" then print(r) return end
local e = assert(read_header(dat))
e.name = read(e.namesize)
e.pos = seek(e.namesize & 1)
seek(e.filesize + (e.filesize & 1))
@ -144,4 +143,4 @@ for i=1, #tbl do
end
end
error("Init not found.")
error("Init not found.")