Skip to content

Commit

Permalink
Remove nullptr dereference while logging zzip error
Browse files Browse the repository at this point in the history
  • Loading branch information
IrneRacoonovich authored and efosamark committed Jan 31, 2024
1 parent 38feecd commit 192c019
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/download_funcs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ bool downloadFile(const std::string& url, const std::string& toDestination) {


bool unzipFile(const std::string& zipFilePath, const std::string& toDestination) {
ZZIP_DIR* dir = zzip_dir_open(zipFilePath.c_str(), nullptr);
zzip_error_t errorCode{ ZZIP_NO_ERROR };
ZZIP_DIR* dir = zzip_dir_open(zipFilePath.c_str(), &errorCode);
if (!dir) {
log("Error opening file: %s; error: %s", zipFilePath.c_str(), zzip_strerror_of(dir));
log("Error opening file: %s; error: %s", zipFilePath.c_str(), zzip_strerror(errorCode));
return false;
}

Expand Down

0 comments on commit 192c019

Please sign in to comment.