Skip to content

Commit 3391a6b

Browse files
committed
Upgraded libzip
1 parent 635d6df commit 3391a6b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

conanfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def set_version(self):
3939
def requirements(self):
4040
self.tool_requires("cmake/[>=3.19]")
4141
self.requires("fmilibrary/[~2.3]")
42-
self.requires("libcbor/[~0.11.0]")
43-
self.requires("libzip/[>=1.7 <1.10]") # 1.10 deprecates some functions we use
42+
self.requires("libcbor/[~0.11]")
43+
self.requires("libzip/[~1.3]")
4444
self.requires("ms-gsl/[>=3 <5]", transitive_headers=True)
4545
self.requires("boost/[~1.85]", transitive_headers=True, transitive_libs=True) # Required by Thrift
4646
if self.options.proxyfmu:

src/cosim/utility/zip.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ void archive::open(const cosim::filesystem::path& path)
107107
int errorCode;
108108
auto archive = zip_open(path.string().c_str(), 0, &errorCode);
109109
if (!archive) {
110-
const auto errnoVal = (errorCode == ZIP_ER_READ ? errno : 0);
111-
auto msgBuf = std::vector<char>(
112-
zip_error_to_str(nullptr, 0, errorCode, errnoVal) + 1);
113-
zip_error_to_str(msgBuf.data(), msgBuf.size(), errorCode, errno);
114-
throw error("Unzipping of file: '" + path.string() + "' failed with error: " + msgBuf.data());
110+
zip_error_t zipError;
111+
zip_error_init_with_code(&zipError, errorCode);
112+
std::string errorMsg = zip_error_strerror(&zipError);
113+
zip_error_fini(&zipError);
114+
throw error("Unzipping of file: '" + path.string() + "' failed with error: " + errorMsg);
115115
}
116116
m_archive = archive;
117117
}

0 commit comments

Comments
 (0)