]> granicus.if.org Git - zziplib/commitdiff
#68 return value of zzip_mem_disk_fread is signed
authorGuido Draheim <guidod@gmx.de>
Mon, 4 Jan 2021 20:51:56 +0000 (21:51 +0100)
committerGuido Draheim <guidod@gmx.de>
Mon, 4 Jan 2021 20:51:56 +0000 (21:51 +0100)
bins/unzzipcat-mem.c

index 6bd79b70b8d2273fcb1023dbf130459635976b24..1b5bc22c8ab40bfdbb00bfabd27590deb6949628 100644 (file)
@@ -35,7 +35,7 @@ static void unzzip_mem_entry_fprint(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);
@@ -48,7 +48,7 @@ static void unzzip_mem_disk_cat_file(ZZIP_MEM_DISK* disk, char* name, FILE* out)
     if (file) 
     {
        char buffer[1025]; int len;
-       while ((len = zzip_mem_disk_fread (buffer, 1, 1024, file))) 
+       while (0 < (len = zzip_mem_disk_fread (buffer, 1, 1024, file))) 
        {
            fwrite (buffer, 1, len, out);
        }