From 24826f851d2e36f8e56d03ff19f875c8f1685bbb Mon Sep 17 00:00:00 2001 From: zabbius Date: Mon, 12 Aug 2024 04:52:03 +0300 Subject: [PATCH] removed duplicated code in args.c --- args.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/args.c b/args.c index fd1b49e..db4a2df 100644 --- a/args.c +++ b/args.c @@ -163,7 +163,6 @@ int parse_args(int argc, char *argv[]) { } else if (strcmp(optarg, "none") == 0) { config.fragmentation_strategy = FRAG_STRAT_NONE; } else { - printf("Invalid option %s\n", long_opt[optIdx].name); goto error; } @@ -175,7 +174,6 @@ int parse_args(int argc, char *argv[]) { config.frag_sni_faked = 0; } else { errno = EINVAL; - printf("Invalid option %s\n", long_opt[optIdx].name); goto error; } @@ -187,7 +185,6 @@ int parse_args(int argc, char *argv[]) { config.frag_sni_reverse = 0; } else { errno = EINVAL; - printf("Invalid option %s\n", long_opt[optIdx].name); goto error; } @@ -199,7 +196,6 @@ int parse_args(int argc, char *argv[]) { config.faking_strategy = FAKE_STRAT_TTL; } else { errno = EINVAL; - printf("Invalid option %s\n", long_opt[optIdx].name); goto error; } @@ -207,7 +203,6 @@ int parse_args(int argc, char *argv[]) { case OPT_FAKING_TTL: num = parse_numeric_option(optarg); if (errno != 0 || num < 0 || num > 255) { - printf("Invalid option %s\n", long_opt[optIdx].name); goto error; } @@ -221,7 +216,6 @@ int parse_args(int argc, char *argv[]) { config.fake_sni = 0; } else { errno = EINVAL; - printf("Invalid option %s\n", long_opt[optIdx].name); goto error; } @@ -229,7 +223,6 @@ int parse_args(int argc, char *argv[]) { case OPT_FAKE_SNI_SEQ_LEN: num = parse_numeric_option(optarg); if (errno != 0 || num < 0 || num > 255) { - printf("Invalid option %s\n", long_opt[optIdx].name); goto error; } @@ -238,7 +231,6 @@ int parse_args(int argc, char *argv[]) { case OPT_FK_WINSIZE: num = parse_numeric_option(optarg); if (errno != 0 || num < 0) { - printf("Invalid option %s\n", long_opt[optIdx].name); goto error; } @@ -247,7 +239,6 @@ int parse_args(int argc, char *argv[]) { case OPT_SEG2DELAY: num = parse_numeric_option(optarg); if (errno != 0 || num < 0) { - printf("Invalid option %s\n", long_opt[optIdx].name); goto error; } @@ -256,7 +247,6 @@ int parse_args(int argc, char *argv[]) { case OPT_THREADS: num = parse_numeric_option(optarg); if (errno != 0 || num < 0 || num > MAX_THREADS) { - printf("Invalid option %s\n", long_opt[optIdx].name); goto error; } @@ -265,7 +255,6 @@ int parse_args(int argc, char *argv[]) { case OPT_QUEUE_NUM: num = parse_numeric_option(optarg); if (errno != 0 || num < 0) { - printf("Invalid option %s\n", long_opt[optIdx].name); goto error; } @@ -284,6 +273,7 @@ out: errno = 0; return 1; error: + printf("Invalid option %s\n", long_opt[optIdx].name); print_usage(argv[0]); errno = EINVAL; return -1;