]> git.ipfire.org Git - pakfire.git/commitdiff
config: Terminate array each round for search
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 19 Apr 2021 16:44:57 +0000 (16:44 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 19 Apr 2021 16:44:57 +0000 (16:44 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/config.c

index 55e3c8313c847cd3a6df3c82c7d6c5d75c7b7731..5bddb45df86e9d5e558adfb66f50b3ac81fbc1b9 100644 (file)
@@ -239,11 +239,10 @@ char** pakfire_config_sections(struct pakfire_config* config) {
                        return NULL;
 
                sections[num_sections - 1] = strdup(entry->section);
-       }
 
-       // Terminate the array
-       if (num_sections)
+               // Terminate the array
                sections[num_sections] = NULL;
+       }
 
        return sections;
 }