summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorZefir Kurtisi <zefir.kurtisi@neratec.com>2015-03-18 16:44:48 +0100
committerJohn Crispin <blogic@openwrt.org>2015-03-18 19:49:59 +0100
commit0cf744c720c9ed01c2dae25f338d4e96b9db95e3 (patch)
tree707b4966a986aa223b07b4127e61a43ff577f935 /utils
parent6c880d28c9fb8d87c3a42b81e7659b7666c78976 (diff)
downloadunitd-0cf744c720c9ed01c2dae25f338d4e96b9db95e3.tar
unitd-0cf744c720c9ed01c2dae25f338d4e96b9db95e3.zip
check for empty parameters in askfirst
Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/askfirst.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/utils/askfirst.c b/utils/askfirst.c
index e78823c..69de76f 100644
--- a/utils/askfirst.c
+++ b/utils/askfirst.c
@@ -31,8 +31,13 @@ int main(int argc, char **argv)
}
while (c != 0xA);
+ if (argc < 2) {
+ printf("%s needs to be called with at least 1 parameter\n", argv[0]);
+ return -1;
+ }
+
execvp(argv[1], &argv[1]);
- printf("Failed to execute %s\n", argv[0]);
+ printf("Failed to execute %s\n", argv[1]);
return -1;
}