1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-04 21:59:02 +00:00

Use const. New function nmap_getprotbyname()

This commit is contained in:
dmiller
2022-09-16 01:10:18 +00:00
parent 721912c113
commit 6c6d4e33b5
3 changed files with 17 additions and 4 deletions

View File

@@ -504,7 +504,7 @@ void printportoutput(const Target *currenths, const PortList *plist) {
char serviceinfo[64];
int i;
int first = 1;
struct nprotoent *proto;
const struct nprotoent *proto;
Port *current;
Port port;
char hostname[1200];
@@ -2282,7 +2282,7 @@ static void printtraceroute_normal(const Target *currenths) {
log_write(LOG_PLAIN, "TRACEROUTE (using port %d/%s)\n",
probe.pd.sctp.dport, proto2ascii_lowercase(probe.proto));
} else if (probe.type == PS_ICMP || probe.type == PS_ICMPV6 || probe.type == PS_PROTO) {
struct nprotoent *proto = nmap_getprotbynum(probe.proto);
const struct nprotoent *proto = nmap_getprotbynum(probe.proto);
log_write(LOG_PLAIN, "TRACEROUTE (using proto %d/%s)\n",
probe.proto, proto ? proto->p_name : "unknown");
} else if (probe.type == PS_NONE) {