projects
/
oweals
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c880d2
)
check for empty parameters in askfirst
author
Zefir Kurtisi
<zefir.kurtisi@neratec.com>
Wed, 18 Mar 2015 15:44:48 +0000
(16:44 +0100)
committer
John Crispin
<blogic@openwrt.org>
Wed, 18 Mar 2015 18:49:59 +0000
(19:49 +0100)
Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
utils/askfirst.c
patch
|
blob
|
history
diff --git
a/utils/askfirst.c
b/utils/askfirst.c
index e78823caefd42b55cf606644cdda0c2132458e8f..69de76fae02ea8325bef75ee4e84f66077161838 100644
(file)
--- 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;
}