]> git.ipfire.org Git - pakfire.git/commitdiff
cli: shell: Make sure packages is always initialized and terminated by NULL
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 6 Oct 2024 17:21:34 +0000 (17:21 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 6 Oct 2024 17:21:34 +0000 (17:21 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/cli/lib/shell.c

index ef0a7da1f0332de1fd970650e6bad9b17cefff2f..98cf983529d5d1225b7ee670f519606feb185f5b 100644 (file)
@@ -33,7 +33,7 @@ struct config {
        int flags;
 
        // Packages
-       const char* packages[MAX_PACKAGES];
+       const char* packages[MAX_PACKAGES + 1];
        unsigned int num_packages;
 };
 
@@ -81,7 +81,7 @@ int cli_shell(void* data, int argc, char* argv[]) {
 
        struct config config = {
                .flags        = 0,
-               .packages     = { NULL },
+               .packages     = {},
                .num_packages = 0,
        };