1
0
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:
benpicco 2020-05-03 14:10:26 +02:00 committed by GitHub
commit 261ff8acb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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")) {