From dd13ceb42d50c4799ca3968ef22017a586d32fa6 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 29 Oct 2022 01:38:34 -0700 Subject: [PATCH] VFS: Fix minizip write returning 0 on success instead of size --- CHANGES | 1 + src/util/vfs/vfs-zip.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 25e4f5efe..581ec1405 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,7 @@ Other fixes: - Qt: Expand criteria for tag branch names (fixes mgba.io/i/2679) - Qt: Fix scanning specific e-Reader dotcodes (fixes mgba.io/i/2693) - Res: Fix species name location in Ruby/Sapphire revs 1/2 (fixes mgba.io/i/2685) + - VFS: Fix minizip write returning 0 on success instead of size Misc: - GB Serialize: Add missing savestate support for MBC6 and NT (newer) - macOS: Add category to plist (closes mgba.io/i/2691) diff --git a/src/util/vfs/vfs-zip.c b/src/util/vfs/vfs-zip.c index 2d353c566..2f8234b94 100644 --- a/src/util/vfs/vfs-zip.c +++ b/src/util/vfs/vfs-zip.c @@ -593,7 +593,11 @@ ssize_t _vfzRead(struct VFile* vf, void* buffer, size_t size) { ssize_t _vfzWrite(struct VFile* vf, const void* buffer, size_t size) { struct VFileZip* vfz = (struct VFileZip*) vf; - return zipWriteInFileInZip(vfz->z, buffer, size); + int res = zipWriteInFileInZip(vfz->z, buffer, size); + if (res != ZIP_OK) { + return res; + } + return size; } void* _vfzMap(struct VFile* vf, size_t size, int flags) {