]> granicus.if.org Git - zziplib/commitdiff
zzip: memdisk: use correct type when when copying extra blocks
authorPatrick Steinhardt <ps@pks.im>
Tue, 21 May 2019 11:45:43 +0000 (13:45 +0200)
committerPatrick Steinhardt <ps@pks.im>
Thu, 1 Aug 2019 06:33:34 +0000 (08:33 +0200)
The data field of `struct zzip_disk` is of type `zzip_byte_t *`, which
is unsigned, but we store them in a `char` field and thus cause
signedness warnings on platforms where `char` is signed. Fix this by
using `zzip_byte_t`, instead.

zzip/memdisk.c

index 9983cc2a01973134569f5601923fa92d9196e2ad..f9088de655927e7078e871d5df842dee1d90260a 100644 (file)
@@ -244,10 +244,10 @@ zzip_mem_entry_new(ZZIP_DISK * disk, ZZIP_DISK_ENTRY * entry)
     }
 
     {   /* copy the extra blocks to memory as well (maximum 64K each) */
-        zzip_size_t /*    */ ext1_len = zzip_disk_entry_get_extras(entry);
-        char *_zzip_restrict ext1_ptr = zzip_disk_entry_to_extras(entry);
-        zzip_size_t /*    */ ext2_len = zzip_file_header_get_extras(header);
-        char *_zzip_restrict ext2_ptr = zzip_file_header_to_extras(header);
+        zzip_size_t /*           */ ext1_len = zzip_disk_entry_get_extras(entry);
+        zzip_byte_t *_zzip_restrict ext1_ptr = zzip_disk_entry_to_extras(entry);
+        zzip_size_t /*           */ ext2_len = zzip_file_header_get_extras(header);
+        zzip_byte_t *_zzip_restrict ext2_ptr = zzip_file_header_to_extras(header);
 
         if (ext1_len > 0 && ext1_len <= 65535)
         {