zip: Properly report error on zip_close (#33)

This commit is contained in:
SoSeDiK 2024-04-12 13:54:39 +03:00 committed by GitHub
parent 178717746d
commit d41e8ac8d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -203,9 +203,8 @@ static std::optional<std::string> createCursorThemeFromPath(const std::string& p
// close zip and write // close zip and write
if (zip_close(zip) < 0) { if (zip_close(zip) < 0) {
zip_error_t ziperror; zip_error_t* ziperror = zip_get_error(zip);
zip_error_init_with_code(&ziperror, errp); return "Failed to write " + OUTPUTFILE + ": " + zip_error_strerror(ziperror);
return "Failed to write " + OUTPUTFILE + ": " + zip_error_strerror(&ziperror);
} }
std::cout << "Written " << OUTPUTFILE << "\n"; std::cout << "Written " << OUTPUTFILE << "\n";