Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
}
PAKFIRE_EXPORT struct pakfire_archive* pakfire_package_get_archive(struct pakfire_package* pkg) {
- struct pakfire_archive* archive;
+ struct pakfire_archive* archive = NULL;
// Otherwise open the archive from the cache
const char* path = pakfire_package_get_path(pkg);
// Open archive
int r = pakfire_archive_open(&archive, pkg->pakfire, path);
+ if (r)
+ return NULL;
- if (r == 0)
- return archive;
-
- return NULL;
+ return archive;
}
static int pakfire_package_fetch_legacy_filelist(struct pakfire_package* pkg, struct pakfire_filelist* filelist) {