From bd30a000ef5683c185f542372133ce977607a002 Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Sun, 23 Feb 2025 20:03:18 +0000 Subject: [PATCH] fix: use proper byte count corresponding to 64 KB --- lib/init.luau | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/init.luau b/lib/init.luau index 2672206..f922c32 100644 --- a/lib/init.luau +++ b/lib/init.luau @@ -453,7 +453,7 @@ function ZipReader.findEocdPosition(self: ZipReader): number local bufSize = buffer.len(self.data) -- Start from the minimum possible position of EoCD (22 bytes from end) - local position = math.max(0, bufSize - (22 + 65578) --[[ max comment size: 64 KB ]]) + local position = math.max(0, bufSize - (22 + 65536) --[[ max comment size: 64 KB ]]) local searchBuf = buffer.create(BUFFER_SIZE) while position < bufSize do @@ -538,6 +538,7 @@ function ZipReader.parseEocdRecord(self: ZipReader, pos: number): EocdRecord end local commentLength = buffer.readu16(self.data, pos + 20) + print("comment len:", commentLength) return { diskNumber = buffer.readu16(self.data, pos + 4), diskWithCD = buffer.readu16(self.data, pos + 6),