Skip to content

Commit

Permalink
fix delete entries fail (#267)
Browse files Browse the repository at this point in the history
* fix delete entries fail

* Do not close file on zip_file_move error

Co-authored-by: Kuba Podgórski <kuba--@users.noreply.github.com>
  • Loading branch information
HellsCoder and kuba-- committed Jun 25, 2022
1 parent 822a973 commit f8c58eb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/build/
/test/build/
/xcodeproj/
/infer-out/
.vscode/
Testing/

Expand Down
5 changes: 0 additions & 5 deletions src/zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,20 +583,15 @@ static ssize_t zip_file_move(MZ_FILE *m_pFile, const mz_uint64 to,
return ZIP_ECAPSIZE;
}
if (MZ_FSEEK64(m_pFile, from, SEEK_SET)) {
MZ_FCLOSE(m_pFile);
return ZIP_EFSEEK;
}

if (fread(move_buf, 1, length, m_pFile) != length) {
MZ_FCLOSE(m_pFile);
return ZIP_EFREAD;
}
if (MZ_FSEEK64(m_pFile, to, SEEK_SET)) {
MZ_FCLOSE(m_pFile);
return ZIP_EFSEEK;
}
if (fwrite(move_buf, 1, length, m_pFile) != length) {
MZ_FCLOSE(m_pFile);
return ZIP_EFWRITE;
}
return (ssize_t)length;
Expand Down

0 comments on commit f8c58eb

Please sign in to comment.