1
0
mirror of https://github.com/Adorable-Catgirl/Zorya-NEO.git synced 2024-11-27 04:38:06 +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 end
local ent = {} local ent = {}
ent.magic, ent.namesize, ent.mode, ent.uid, ent.gid, ent.filesize, ent.mtime = string.unpack(e..header_fmt, dat) 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 end
local lname = "" local lname = ""
while lname ~= "TRAILER!!!" do while lname ~= "TRAILER!!!" do
local dat = read(22) local dat = read(22)
local e,r = read_header(dat) local e = assert(read_header(dat))
if r ~= "" then print(r) return end
e.name = read(e.namesize) e.name = read(e.namesize)
e.pos = seek(e.namesize & 1) e.pos = seek(e.namesize & 1)
seek(e.filesize + (e.filesize & 1)) seek(e.filesize + (e.filesize & 1))