From: Michael Tremer Date: Wed, 23 Oct 2024 11:15:48 +0000 (+0000) Subject: package: Initialize r X-Git-Tag: 0.9.30~925 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7163bba9f0b63ba51cc0919641bb690b6b55da15;p=pakfire.git package: Initialize r Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/package.c b/src/libpakfire/package.c index 412186fa8..225661f2e 100644 --- a/src/libpakfire/package.c +++ b/src/libpakfire/package.c @@ -666,7 +666,7 @@ int pakfire_package_set_strings_from_string(struct pakfire_package* pkg, const enum pakfire_package_key key, const char* value) { char* buffer = NULL; char* p = NULL; - int r; + int r = 0; // Drop any previous values pakfire_package_unset(pkg, key); @@ -688,7 +688,7 @@ int pakfire_package_set_strings_from_string(struct pakfire_package* pkg, // Add each part individually while (s) { r = pakfire_package_add_string(pkg, key, s); - if (r) + if (r < 0) goto ERROR; // Move on to the next part