fix: data races with getservent

feature: time elapsed in the print
This commit is contained in:
0x35c
2025-06-05 11:10:42 +02:00
parent eaf5913c29
commit 31530c83a4
3 changed files with 32 additions and 14 deletions

View File

@ -68,7 +68,6 @@ static void print_port_state(uint16_t port, e_scantype type,
void print_host_results(const struct scan *general, double scan_time)
{
printf("Scan took %lf secs\n", scan_time);
printf("IP address: %s\n", general->dest_addr);
printf("Opened ports:\n");
for (uint16_t port = general->port_start; port < general->port_end;
@ -87,4 +86,5 @@ void print_host_results(const struct scan *general, double scan_time)
if (!is_port_opened(response->states, general->type))
print_port_state(port, general->type, response);
}
printf("\nScan took %lf secs\n", scan_time);
}