mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Make sure now has a value before assigning it to last_print in
ScanProgressMeter::printStats. I messed this up in r11985. Brandon reported the problem.
This commit is contained in:
parent
1491180c50
commit
fda214ed63
1 changed files with 5 additions and 5 deletions
10
timing.cc
10
timing.cc
|
|
@ -560,6 +560,11 @@ bool ScanProgressMeter::printStats(double perc_done,
|
|||
time_t timet;
|
||||
struct tm *ltime;
|
||||
|
||||
if (!now) {
|
||||
gettimeofday(&tvtmp, NULL);
|
||||
now = (const struct timeval *) &tvtmp;
|
||||
}
|
||||
|
||||
last_print = *now;
|
||||
|
||||
// If we're less than 1% done we probably don't have enough
|
||||
|
|
@ -572,11 +577,6 @@ bool ScanProgressMeter::printStats(double perc_done,
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!now) {
|
||||
gettimeofday(&tvtmp, NULL);
|
||||
now = (const struct timeval *) &tvtmp;
|
||||
}
|
||||
|
||||
/* OK, now lets estimate the time to finish */
|
||||
time_used_s = difftime(now->tv_sec, begin.tv_sec);
|
||||
time_needed_s = time_used_s / perc_done;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue