I don't have to close it myself anymore

This commit is contained in:
Casey 2024-09-13 01:17:20 +03:00
parent 17cc43fe89
commit 712346e2c5
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 0 additions and 2 deletions

View File

@ -74,12 +74,10 @@ local function parse(fp)
elseif magic:sub(1, 3) == "CPI" then
local version = magic:byte(4, 4)
if decoders[version] == nil then
fp:close()
return nil, string.format("Invalid CPI version 0x%02x", version)
end
res, err = decoders[version](image, fp)
else
fp:close()
return nil, "Invalid header: expected CCPI got " .. magic
end