mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 06:23:53 +01:00
Merge pull request #14005 from francois-berder/fix-pm-args
sys/shell: commands: Check argc in _pm_handler
This commit is contained in:
commit
261ff8acb5
@ -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")) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user