sys/shell: commands: Check argc in _pm_handler

Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
This commit is contained in:
Francois Berder
2020-05-02 20:55:28 +01:00
parent 99e8b04921
commit 31cdcdd0a4
+5 -2
View File
@@ -149,6 +149,11 @@ static int cmd_off(char *arg)
int _pm_handler(int argc, char **argv)
{
if (argc < 2) {
_print_usage();
return 1;
}
#ifdef MODULE_PM_LAYERED
if (!strcmp(argv[1], "show")) {
if (argc != 2) {
@@ -182,8 +187,6 @@ int _pm_handler(int argc, char **argv)
return cmd_set(argv[2]);
}
#else
(void)argc;
#endif /* MODULE_PM_LAYERED */
if (!strcmp(argv[1], "off")) {