Home page logo
/

nmap-dev logo Nmap Development mailing list archives

[PATCH] Remove parameter 'name' from printusage() in nmap.cc
From: Kris Katterjohn <kjak () ispwest com>
Date: Fri, 10 Mar 2006 15:49:37 -0600

The attached patch removes the argument/parameter 'name' from printusage()
because it's not used. Or is there a reason it's left there?

Thanks,
Kris
--- nmap.cc.orig        2006-03-08 16:06:21.000000000 -0600
+++ nmap.cc     2006-03-10 14:36:57.000000000 -0600
@@ -192,7 +192,7 @@ static int parse_bounce_argument(struct 
   return 1;
 }
 
-static void printusage(char *name, int rc) {
+static void printusage(int rc) {
 
 printf("%s %s ( %s )\n"
        "Usage: nmap [Scan Type(s)] [Options] {target specification}\n"
@@ -574,7 +574,7 @@ int nmap_main(int argc, char *argv[]) {
   }
   fakeargv[argc] = NULL;
 
-  if (argc < 2 ) printusage(argv[0], -1);
+  if (argc < 2 ) printusage(-1);
   Targets.reserve(100);
 #ifdef WIN32
   win_pre_init();
@@ -836,8 +836,8 @@ int nmap_main(int argc, char *argv[]) {
       o.magic_port_set = 1;
       if (o.magic_port == 0) error("WARNING: a source port of zero may not work on all systems.");
       break;    
-    case 'h': printusage(argv[0], 0); break;
-    case '?': printusage(argv[0], -1); break;
+    case 'h': printusage(0); break;
+    case '?': printusage(-1); break;
     case 'I': 
       printf("WARNING: identscan (-I) no longer supported.  Ignoring -I\n");
       break;
@@ -965,7 +965,7 @@ int nmap_main(int argc, char *argv[]) {
     case 's': 
       if (!*optarg) {
        fprintf(stderr, "An option is required for -s, most common are -sT (tcp scan), -sS (SYN scan), -sF (FIN scan), 
-sU (UDP scan) and -sP (Ping scan)");
-       printusage(argv[0], -1);
+       printusage(-1);
       }
       p = optarg;
       while(*p) {
@@ -988,7 +988,7 @@ int nmap_main(int argc, char *argv[]) {
          o.udpscan++;
          break;
        case 'X':  o.xmasscan++;break;
-       default:  error("Scantype %c not supported\n",*p); printusage(argv[0], -1); break;
+       default:  error("Scantype %c not supported\n",*p); printusage(-1); break;
        }
        p++;
       }


_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev

  By Date           By Thread  

Current thread:
  • [PATCH] Remove parameter 'name' from printusage() in nmap.cc Kris Katterjohn (Mar 10)
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]
AlienVault