diff options
author | Seppia <nonso@insicuri.net> | 2016-06-09 15:10:42 +0200 |
---|---|---|
committer | Seppia <nonso@insicuri.net> | 2016-06-09 15:10:42 +0200 |
commit | b4fdcac63613c7d114b2ccb004fa053577811f2e (patch) | |
tree | 24ac6837d0c8df260c15dceee8ab04b1e28355b6 | |
parent | a5100d0374dc95500e859a038aca249d8ecb532c (diff) | |
download | onetimebluh-b4fdcac63613c7d114b2ccb004fa053577811f2e.tar.gz onetimebluh-b4fdcac63613c7d114b2ccb004fa053577811f2e.tar.bz2 onetimebluh-b4fdcac63613c7d114b2ccb004fa053577811f2e.zip |
keygen 'no option specified' detection
-rw-r--r-- | keygen.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -9,6 +9,7 @@ int main(int argc, char* argv[]) { char* output; int defout = 0; int defbyte = 0; + int noopts = 0; while ((opt = getopt(argc, argv, "b:o:")) != -1) { switch (opt) { case 'b': @@ -23,8 +24,14 @@ int main(int argc, char* argv[]) { fprintf(stderr, "Usage: %s [-b nbytes] [-o output] \n", argv[0]); exit(EXIT_FAILURE); } + if (noopts == 0) { + noopts = 1; + } } + if(noopts == 0) { + printf("WARNING no option specified usign default values... \n"); + } if (nbytes < 0) { printf("Negative byte value inserted! \n"); printf("Exiting... \n"); |