]> git.ipfire.org Git - people/ric9/pakfire.git/commitdiff
parser: Tidy up for finding declarations
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 12:30:01 +0000 (12:30 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 12:30:01 +0000 (12:30 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/parser.c

index 6ece68982fbc65ca2e390f8d7b92b1f0a19f12b5..3a1a40c8e83ea8f21c0be5108e74b3486b1195a6 100644 (file)
@@ -285,14 +285,14 @@ static char* pakfire_parser_join(const char* c, const char* val1, const char* va
 
 static struct pakfire_parser_declaration* pakfire_parser_find_declaration(
                struct pakfire_parser* parser, const char* namespace, const char* name) {
-       struct pakfire_parser_declaration* d;
+       struct pakfire_parser_declaration* d = NULL;
        char* n = NULL;
 
        // Create a working copy of namespace
        if (namespace)
                n = strdupa(namespace);
 
-       while (1) {
+       for (;;) {
                d = pakfire_parser_get_declaration_recursive(parser, n, name);
                if (d && d->value)
                        return d;