1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 20:29:03 +00:00

Change o.TimeSinceStartMS returning milliseconds to o.TimeSinceStart

returning floating-point seconds. Everywhere o.TimeSinceStartMS was
called, the return value was being divided by 1000.0, which had the same
effect but would overflow when the difference exceeded about 25 days
(2^31 milliseconds). This patch is by Daniel Miller.
This commit is contained in:
david
2011-03-28 20:34:32 +00:00
parent 0fb893af03
commit 7453ec34d0
7 changed files with 20 additions and 17 deletions

View File

@@ -113,9 +113,9 @@ class NmapOps {
// The time this obj. was instantiated or last ReInit()ed.
const struct timeval *getStartTime() { return &start_time; }
// Number of milliseconds since getStartTime(). The current time is an
// Number of seconds since getStartTime(). The current time is an
// optional argument to avoid an extra gettimeofday() call.
int TimeSinceStartMS(const struct timeval *now=NULL);
float TimeSinceStart(const struct timeval *now=NULL);
struct in_addr v4source();
const struct in_addr *v4sourceip();