summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeppia <nonso@insicuri.net>2016-06-09 15:10:42 +0200
committerSeppia <nonso@insicuri.net>2016-06-09 15:10:42 +0200
commitb4fdcac63613c7d114b2ccb004fa053577811f2e (patch)
tree24ac6837d0c8df260c15dceee8ab04b1e28355b6
parenta5100d0374dc95500e859a038aca249d8ecb532c (diff)
downloadonetimebluh-b4fdcac63613c7d114b2ccb004fa053577811f2e.tar.gz
onetimebluh-b4fdcac63613c7d114b2ccb004fa053577811f2e.tar.bz2
onetimebluh-b4fdcac63613c7d114b2ccb004fa053577811f2e.zip
keygen 'no option specified' detection
-rw-r--r--keygen.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/keygen.c b/keygen.c
index 7e49a85..f3793ea 100644
--- a/keygen.c
+++ b/keygen.c
@@ -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");