From b2d25c8b4d9036d9e8e7c47aae78a64518104032 Mon Sep 17 00:00:00 2001 From: fyodor Date: Sat, 11 Aug 2007 03:28:01 +0000 Subject: [PATCH] merge soc07 r4792 - Fixing --port_ratio and --top_ports option names (using optcmp instead of strcmp and adding underscore versions to long_options[]) --- nmap.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nmap.cc b/nmap.cc index 890ed1d11..3c98b7e51 100644 --- a/nmap.cc +++ b/nmap.cc @@ -605,7 +605,9 @@ int nmap_main(int argc, char *argv[]) { {"dns_servers", required_argument, 0, 0}, {"dns-servers", required_argument, 0, 0}, {"port-ratio", required_argument, 0, 0}, + {"port_ratio", required_argument, 0, 0}, {"top-ports", required_argument, 0, 0}, + {"top_ports", required_argument, 0, 0}, #ifndef NOLUA {"script", required_argument, 0, 0}, {"script-trace", no_argument, 0, 0}, @@ -835,12 +837,12 @@ int nmap_main(int argc, char *argv[]) { o.fragscan = atoi(optarg); if (o.fragscan <= 0 || o.fragscan % 8 != 0) fatal("Data payload MTU must be >0 and multiple of 8"); - } else if (strcmp(long_options[option_index].name, "port-ratio") == 0) { + } else if (optcmp(long_options[option_index].name, "port-ratio") == 0) { char *ptr; o.topportlevel = strtod(optarg, &ptr); if (!ptr || o.topportlevel < 0 || o.topportlevel >= 1) fatal("--port-ratio should be between [0 and 1)"); - } else if (strcmp(long_options[option_index].name, "top-ports") == 0) { + } else if (optcmp(long_options[option_index].name, "top-ports") == 0) { char *ptr; o.topportlevel = strtod(optarg, &ptr); if (!ptr || o.topportlevel < 1 || ((double)((int)o.topportlevel)) != o.topportlevel)