Skip to content

Commit

Permalink
Upgraded libzip
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhjp01 committed Feb 7, 2025
1 parent 635d6df commit 3391a6b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def set_version(self):
def requirements(self):
self.tool_requires("cmake/[>=3.19]")
self.requires("fmilibrary/[~2.3]")
self.requires("libcbor/[~0.11.0]")
self.requires("libzip/[>=1.7 <1.10]") # 1.10 deprecates some functions we use
self.requires("libcbor/[~0.11]")
self.requires("libzip/[~1.3]")
self.requires("ms-gsl/[>=3 <5]", transitive_headers=True)
self.requires("boost/[~1.85]", transitive_headers=True, transitive_libs=True) # Required by Thrift
if self.options.proxyfmu:
Expand Down
10 changes: 5 additions & 5 deletions src/cosim/utility/zip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ void archive::open(const cosim::filesystem::path& path)
int errorCode;
auto archive = zip_open(path.string().c_str(), 0, &errorCode);
if (!archive) {
const auto errnoVal = (errorCode == ZIP_ER_READ ? errno : 0);
auto msgBuf = std::vector<char>(
zip_error_to_str(nullptr, 0, errorCode, errnoVal) + 1);
zip_error_to_str(msgBuf.data(), msgBuf.size(), errorCode, errno);
throw error("Unzipping of file: '" + path.string() + "' failed with error: " + msgBuf.data());
zip_error_t zipError;
zip_error_init_with_code(&zipError, errorCode);
std::string errorMsg = zip_error_strerror(&zipError);
zip_error_fini(&zipError);
throw error("Unzipping of file: '" + path.string() + "' failed with error: " + errorMsg);
}
m_archive = archive;
}
Expand Down

0 comments on commit 3391a6b

Please sign in to comment.