From 9cd9d98300af3039db7f146a47914baef2e8ea1b Mon Sep 17 00:00:00 2001 From: Enrico Jorns Date: Mon, 12 Sep 2016 12:20:56 +0200 Subject: commands: exit on invalid option Barebox commands should not perform any action and return 0 if an invalid parameter was given. This might cause undetected unintended behvaior when calling commands with wrong options, either manually or from a script. Signed-off-by: Enrico Jorns Signed-off-by: Sascha Hauer --- commands/reset.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'commands/reset.c') diff --git a/commands/reset.c b/commands/reset.c index 830048049a..6eac532623 100644 --- a/commands/reset.c +++ b/commands/reset.c @@ -34,6 +34,8 @@ static int cmd_reset(int argc, char *argv[]) case 'f': shutdown_flag = 0; break; + default: + return COMMAND_ERROR_USAGE; } } -- cgit v1.2.3