From: Michael Tremer Date: Sun, 6 Oct 2024 17:21:34 +0000 (+0000) Subject: cli: shell: Make sure packages is always initialized and terminated by NULL X-Git-Tag: 0.9.30~1129 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=470b114d70d7e74869dc1ef6d273c1b6725f3dec;p=pakfire.git cli: shell: Make sure packages is always initialized and terminated by NULL Signed-off-by: Michael Tremer --- diff --git a/src/cli/lib/shell.c b/src/cli/lib/shell.c index ef0a7da1f..98cf98352 100644 --- a/src/cli/lib/shell.c +++ b/src/cli/lib/shell.c @@ -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, };