瀏覽代碼

Update contrib/zip to fix data loss warning (#6152)

Without these changes, the warning "Type conversion may result in loss of data" might be triggered because `i` is of type `ssize_t` but the type of the parameter is `mz_uint` that is an alias for `unsinged int`.
This was already fixed in the original repository
see
https://github.com/kuba--/zip/blob/d7a2252a537926cbdef8512741a322a183fcfd09/src/zip.c#L481C49-L481C58
and
https://github.com/kuba--/zip/blob/d7a2252a537926cbdef8512741a322a183fcfd09/src/zip.c#L538

Co-authored-by: Kim Kulling <[email protected]>
Xavier Bonaventura 4 月之前
父節點
當前提交
b40e41f9c3
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      contrib/zip/src/zip.c

+ 2 - 2
contrib/zip/src/zip.c

@@ -471,7 +471,7 @@ static ssize_t zip_entry_mark(struct zip_t *zip,
       entry_mark[i].type = MZ_KEEP;
     }
 
-    if (!mz_zip_reader_file_stat(&zip->archive, i, &file_stat)) {
+    if (!mz_zip_reader_file_stat(&zip->archive, (mz_uint)i, &file_stat)) {
       return ZIP_ENOENT;
     }
 
@@ -528,7 +528,7 @@ static ssize_t zip_entry_markbyindex(struct zip_t *zip,
       entry_mark[i].type = MZ_KEEP;
     }
 
-    if (!mz_zip_reader_file_stat(&zip->archive, i, &file_stat)) {
+    if (!mz_zip_reader_file_stat(&zip->archive, (mz_uint)i, &file_stat)) {
       return ZIP_ENOENT;
     }