From 7e786544084548da7fcfcd9090d3c4e7f5777f7e Mon Sep 17 00:00:00 2001
From: Guido Draheim <guidod@gmx.de>
Date: Mon, 4 Jan 2021 21:50:26 +0100
Subject: [PATCH 02/35] #68 return value of zzip_mem_disk_fread is signed

---
 bins/unzip-mem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bins/unzip-mem.c b/bins/unzip-mem.c
index cc009f8..50eb5a6 100644
--- a/bins/unzip-mem.c
+++ b/bins/unzip-mem.c
@@ -81,7 +81,7 @@ static void zzip_mem_entry_pipe(ZZIP_MEM_DISK* disk,
     if (file) 
     {
 	char buffer[1024]; int len;
-	while ((len = zzip_mem_disk_fread (buffer, 1024, 1, file)))
+	while (0 < (len = zzip_mem_disk_fread (buffer, 1024, 1, file)))
 	    fwrite (buffer, len, 1, out);
 	
 	zzip_mem_disk_fclose (file);
@@ -115,7 +115,7 @@ static void zzip_mem_entry_test(ZZIP_MEM_DISK* disk,
     {
 	unsigned long crc = crc32 (0L, NULL, 0);
 	unsigned char buffer[1024]; int len; 
-	while ((len = zzip_mem_disk_fread (buffer, 1024, 1, file))) {
+	while (0 < (len = zzip_mem_disk_fread (buffer, 1024, 1, file))) {
 	    crc = crc32 (crc, buffer, len);
 	}
 	
-- 
1.8.3.1

