From 75cd409ba5ba8d7e9a0ad0c6414b1dd6bc01f160 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 19 Jul 2011 21:40:32 +0000 Subject: [PATCH] Fix some [-Wunused-but-set-variable] warnings. --- idle_scan.cc | 5 ----- osscan.cc | 3 --- service_scan.cc | 12 ++++-------- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/idle_scan.cc b/idle_scan.cc index 0124fdb7e..ca21d5e84 100644 --- a/idle_scan.cc +++ b/idle_scan.cc @@ -150,7 +150,6 @@ static int ipid_proxy_probe(struct idle_proxy_info *proxy, int *probes_sent, int ipid = -1; int to_usec; unsigned int bytes; - int timedout = 0; int base_port; struct ip *ip; struct tcp_hdr *tcp; @@ -167,7 +166,6 @@ static int ipid_proxy_probe(struct idle_proxy_info *proxy, int *probes_sent, do { - timedout = 0; gettimeofday(&tv_sent[tries], NULL); /* Time to send the pr0be!*/ @@ -977,7 +975,6 @@ void idle_scan(Target *target, u16 *portarray, int numports, int groupsz; int portidx = 0; /* Used for splitting the port array into chunks */ int portsleft; - time_t starttime; char scanname[128]; Snprintf(scanname, sizeof(scanname), "idle scan against %s", target->NameIP()); ScanProgressMeter SPM(scanname); @@ -1005,8 +1002,6 @@ void idle_scan(Target *target, u16 *portarray, int numports, strncpy(lastproxy, proxyName, sizeof(lastproxy)); } - starttime = time(NULL); - /* If we don't have timing infoz for the new target, we'll use values derived from the proxy */ if (target->to.srtt == -1 && target->to.rttvar == -1) { diff --git a/osscan.cc b/osscan.cc index 4bd3a4076..7775d7250 100644 --- a/osscan.cc +++ b/osscan.cc @@ -996,8 +996,6 @@ char line[2048]; int lineno = 0; bool parsingMatchPoints = false; -int classno = 0; /* Number of Class lines dealt with so far */ - DB = new FingerPrintDB; char *p, *q; /* OH YEAH!!!! */ @@ -1050,7 +1048,6 @@ while(fgets(line, sizeof(line), fp)) { } current->line = lineno; - classno = 0; /* Now we read the fingerprint itself */ while(fgets(line, sizeof(line), fp)) { diff --git a/service_scan.cc b/service_scan.cc index 5748de6f0..a3a01eda0 100644 --- a/service_scan.cc +++ b/service_scan.cc @@ -449,7 +449,6 @@ void ServiceProbeMatch::InitMatch(const char *matchtext, int lineno) { // NULL. const struct MatchDetails *ServiceProbeMatch::testMatch(const u8 *buf, int buflen) { int rc; - int i; static char product[80]; static char version[80]; static char info[256]; /* We will truncate with ... later */ @@ -480,8 +479,8 @@ const struct MatchDetails *ServiceProbeMatch::testMatch(const u8 *buf, int bufle } else { // Yeah! Match apparently succeeded. // Now lets get the version number if available - i = getVersionStr(buf, buflen, ovector, rc, product, sizeof(product), version, sizeof(version), info, sizeof(info), - hostname, sizeof(hostname), ostype, sizeof(ostype), devicetype, sizeof(devicetype)); + getVersionStr(buf, buflen, ovector, rc, product, sizeof(product), version, sizeof(version), info, sizeof(info), + hostname, sizeof(hostname), ostype, sizeof(ostype), devicetype, sizeof(devicetype)); if (*product) MD_return.product = product; if (*version) MD_return.version = version; if (*info) MD_return.info = info; @@ -1429,7 +1428,6 @@ void ServiceNFO::addToServiceFingerprint(const char *probeName, const u8 *resp, struct tm *ltime; time_t timep; char buf[128]; - int len; assert(resplen); assert(probeName); @@ -1449,13 +1447,13 @@ void ServiceNFO::addToServiceFingerprint(const char *probeName, const u8 *resp, if (servicefplen == 0) { timep = time(NULL); ltime = localtime(&timep); - len = Snprintf(buf, sizeof(buf), "SF-Port%hu-%s:V=%s%s%%I=%d%%D=%d/%d%%Time=%X%%P=%s", portno, proto2ascii_uppercase(proto), NMAP_VERSION, (tunnel == SERVICE_TUNNEL_SSL)? "%T=SSL" : "", o.version_intensity, ltime->tm_mon + 1, ltime->tm_mday, (int) timep, NMAP_PLATFORM); + Snprintf(buf, sizeof(buf), "SF-Port%hu-%s:V=%s%s%%I=%d%%D=%d/%d%%Time=%X%%P=%s", portno, proto2ascii_uppercase(proto), NMAP_VERSION, (tunnel == SERVICE_TUNNEL_SSL)? "%T=SSL" : "", o.version_intensity, ltime->tm_mon + 1, ltime->tm_mday, (int) timep, NMAP_PLATFORM); addServiceString(buf, servicewrap); } // Note that we give the total length of the response, even though we // may truncate - len = Snprintf(buf, sizeof(buf), "%%r(%s,%X,\"", probeName, resplen); + Snprintf(buf, sizeof(buf), "%%r(%s,%X,\"", probeName, resplen); addServiceString(buf, servicewrap); // Now for the probe response itself ... @@ -2437,7 +2435,6 @@ int service_scan(vector &Targets) { struct timeval now; int timeout; enum nsock_loopstatus looprc; - time_t starttime; struct timeval starttv; if (Targets.size() == 0) @@ -2463,7 +2460,6 @@ int service_scan(vector &Targets) { } gettimeofday(&starttv, NULL); - starttime = time(NULL); if (o.verbose) { char targetstr[128]; bool plural = (Targets.size() != 1);