[v2] batctl: exit on parse error in batctl ll
Commit Message
If the argument could not be understood, we should not try to
apply something, but return from the function.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
sys.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
Comments
On Monday, January 23, 2012 02:31:03 Simon Wunderlich wrote:
> If the argument could not be understood, we should not try to
> apply something, but return from the function.
Applied in revision b320bf2.
Thanks,
Marek
@@ -221,8 +221,11 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv)
log_level |= (1 << 1);
else if (strcmp(argv[i], "tt") == 0)
log_level |= (1 << 2);
- else
+ else {
log_level_usage();
+ res = EXIT_FAILURE;
+ goto out;
+ }
}
snprintf(str, sizeof(str), "%i", log_level);