1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-11 10:19:03 +00:00

Avoid multiple expansions of TIMEVAL_MSEC_SUBTRACT macro within MAX macro

This commit is contained in:
dmiller
2024-06-27 19:36:04 +00:00
parent f0fab247db
commit dcb4ba569e
6 changed files with 23 additions and 11 deletions

View File

@@ -242,8 +242,10 @@ int kqueue_loop(struct npool *nsp, int msec_timeout) {
nse = next_expirable_event(nsp);
if (!nse)
event_msecs = -1; /* None of the events specified a timeout */
else
event_msecs = MAX(0, TIMEVAL_MSEC_SUBTRACT(nse->timeout, nsock_tod));
else {
event_msecs = TIMEVAL_MSEC_SUBTRACT(nse->timeout, nsock_tod);
event_msecs = MAX(0, event_msecs);
}
#if HAVE_PCAP
#ifndef PCAP_CAN_DO_SELECT