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/loadxy.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'commands/loadxy.c') diff --git a/commands/loadxy.c b/commands/loadxy.c index a4b1bec94d..a2aab0fc85 100644 --- a/commands/loadxy.c +++ b/commands/loadxy.c @@ -67,8 +67,7 @@ static int do_loady(int argc, char *argv[]) cname = optarg; break; default: - perror(argv[0]); - return 1; + return COMMAND_ERROR_USAGE; } } -- cgit v1.2.3