mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Fix zip file extraction error
This commit is contained in:
parent
c437b386f6
commit
4d545fd2ca
2 changed files with 4 additions and 4 deletions
|
|
@ -132,7 +132,7 @@ static bool mod_import_zip(char* path, bool* isLua, bool* isDynos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to extract all the files to the heap.
|
// Try to extract all the files to the heap.
|
||||||
size_t uncompSize;
|
size_t uncompSize = 0;
|
||||||
const char* p = mz_zip_reader_extract_file_to_heap(&zip_archive, file_stat.m_filename, &uncompSize, 0);
|
const char* p = mz_zip_reader_extract_file_to_heap(&zip_archive, file_stat.m_filename, &uncompSize, 0);
|
||||||
if (!p) {
|
if (!p) {
|
||||||
LOG_ERROR("mz_zip_reader_extract_file_to_heap() failed!");
|
LOG_ERROR("mz_zip_reader_extract_file_to_heap() failed!");
|
||||||
|
|
@ -155,11 +155,11 @@ static bool mod_import_zip(char* path, bool* isLua, bool* isDynos) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t wbytes = fwrite(p, 1, uncompSize, fout);
|
||||||
fclose(fout);
|
fclose(fout);
|
||||||
|
|
||||||
size_t wbytes = fwrite(p, 1, uncompSize, fout);
|
|
||||||
if (wbytes != uncompSize) {
|
if (wbytes != uncompSize) {
|
||||||
LOG_ERROR("Write error on zip mod import");
|
LOG_ERROR("Write error on zip mod import: %u != %u", (u32)wbytes, (u32)uncompSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_INFO("Successfully extracted file \"%s\", size %u", file_stat.m_filename, (u32)uncompSize);
|
LOG_INFO("Successfully extracted file \"%s\", size %u", file_stat.m_filename, (u32)uncompSize);
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
*
|
*
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
#pragma GCC diagnostic ignored "-Wtype-limits"
|
||||||
|
|
||||||
typedef unsigned char mz_validate_uint16[sizeof(mz_uint16) == 2 ? 1 : -1];
|
typedef unsigned char mz_validate_uint16[sizeof(mz_uint16) == 2 ? 1 : -1];
|
||||||
typedef unsigned char mz_validate_uint32[sizeof(mz_uint32) == 4 ? 1 : -1];
|
typedef unsigned char mz_validate_uint32[sizeof(mz_uint32) == 4 ? 1 : -1];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue