1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-20 05:09:02 +00:00

Fix some [-Wunused-but-set-variable] warnings.

This commit is contained in:
david
2011-07-19 21:40:32 +00:00
parent 532eab87e7
commit 75cd409ba5
3 changed files with 4 additions and 16 deletions

View File

@@ -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) {

View File

@@ -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)) {

View File

@@ -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<Target *> &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<Target *> &Targets) {
}
gettimeofday(&starttv, NULL);
starttime = time(NULL);
if (o.verbose) {
char targetstr[128];
bool plural = (Targets.size() != 1);