]> git.ipfire.org Git - pakfire.git/commitdiff
package: Initialize r
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 23 Oct 2024 11:15:48 +0000 (11:15 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 23 Oct 2024 11:15:48 +0000 (11:15 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/package.c

index 412186fa80c8971bc9c0ae6ab0246b20b1900ab9..225661f2eb4b7e2ecfd8d162fcee7733689bc8e6 100644 (file)
@@ -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