From b928b62d29510843c0f0eb3bf890dda6942e41f0 Mon Sep 17 00:00:00 2001 From: neonloop Date: Sun, 16 Jul 2023 18:12:29 +0000 Subject: Fixes problem with uncompressed zip files --- unzip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'unzip.c') diff --git a/unzip.c b/unzip.c index abd0d55..574e1ea 100644 --- a/unzip.c +++ b/unzip.c @@ -25,10 +25,10 @@ static int write_uncompressed(FILE *zip, FILE *dest, size_t size) { while (size) { size_t wsize = MIN(size, CHUNK); - if (size != fread(buf, 1, wsize, zip)) { + if (wsize != fread(buf, 1, wsize, zip)) { return -1; } - if (size != fwrite(buf, 1, wsize, zip)) { + if (wsize != fwrite(buf, 1, wsize, dest)) { return -1; } size -= wsize; -- cgit v1.2.3