diff options
author | Enrico Jorns <ejo@pengutronix.de> | 2016-09-12 12:20:56 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-09-16 09:36:26 +0200 |
commit | 9cd9d98300af3039db7f146a47914baef2e8ea1b (patch) | |
tree | 6919f2da2e25f64089ffb1771c430f7c341e8342 /commands/hwclock.c | |
parent | a38b7017b3d9b16fcc08c5d1ae83cd920a6af699 (diff) | |
download | barebox-9cd9d98300af3039db7f146a47914baef2e8ea1b.tar.gz barebox-9cd9d98300af3039db7f146a47914baef2e8ea1b.tar.xz |
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 <ejo@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/hwclock.c')
-rw-r--r-- | commands/hwclock.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/commands/hwclock.c b/commands/hwclock.c index 6a0fe0342a..5073618675 100644 --- a/commands/hwclock.c +++ b/commands/hwclock.c @@ -123,6 +123,8 @@ static int do_hwclock(int argc, char *argv[]) ntp_to_hw = 1; ntpserver = optarg; break; + default: + return COMMAND_ERROR_USAGE; } } |