summaryrefslogtreecommitdiffstats
path: root/commands/mem.c
diff options
context:
space:
mode:
authorEnrico Jorns <ejo@pengutronix.de>2016-09-12 12:20:56 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-09-16 09:36:26 +0200
commit9cd9d98300af3039db7f146a47914baef2e8ea1b (patch)
tree6919f2da2e25f64089ffb1771c430f7c341e8342 /commands/mem.c
parenta38b7017b3d9b16fcc08c5d1ae83cd920a6af699 (diff)
downloadbarebox-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/mem.c')
-rw-r--r--commands/mem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/mem.c b/commands/mem.c
index 907f1f76a8..29eaa80b23 100644
--- a/commands/mem.c
+++ b/commands/mem.c
@@ -74,7 +74,7 @@ int mem_parse_options(int argc, char *argv[], char *optstr, int *mode,
*swab = 1;
break;
default:
- return -1;
+ return COMMAND_ERROR_USAGE;
}
}