From 13c70a9bfdb768cb64a3d460575a98129a166d3e Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 11 Oct 2018 04:47:21 +0000 Subject: [PATCH] Avoid double-printing stats-every in an effort to 'catch up' --- nmap_tty.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nmap_tty.cc b/nmap_tty.cc index 4ba8ea5ba..514d17f96 100644 --- a/nmap_tty.cc +++ b/nmap_tty.cc @@ -367,9 +367,10 @@ bool keyWasPressed() if (TIMEVAL_AFTER(now, stats_time)) { /* Advance to the next print time. */ TIMEVAL_ADD(stats_time, stats_time, (time_t) (o.stats_interval * 1000000)); - /* If it's still in the past, catch it up to the present. */ + /* If it's still in the past, catch it up to the present, + * plus half a second to avoid double-printing without any progress. */ if (TIMEVAL_AFTER(now, stats_time)) - stats_time = now; + TIMEVAL_MSEC_ADD(stats_time, now, 500); printStatusMessage(); /* Instruct the caller to print status too. */ return true;