X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fprocd.git;a=blobdiff_plain;f=utils%2Faskfirst.c;h=69de76fae02ea8325bef75ee4e84f66077161838;hp=e78823caefd42b55cf606644cdda0c2132458e8f;hb=d749b2a3507517ff0fe39f7dac69f44ce20c56a2;hpb=44803f0b48e6b0bbc56b1f9f8c2ea9c8e1003302 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; }