mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Use targetname, the forward DNS name, in Target::NameIP if it is
available, in preference to hostname, the reverse DNS name. NameIP is used to represent the host in output messages.
This commit is contained in:
parent
7f62aa5196
commit
d09218c755
1 changed files with 5 additions and 2 deletions
|
|
@ -325,9 +325,12 @@ void Target::setTargetName(char *name) {
|
|||
const char *Target::NameIP(char *buf, size_t buflen) {
|
||||
assert(buf);
|
||||
assert(buflen > 8);
|
||||
if (hostname) {
|
||||
if (targetname)
|
||||
Snprintf(buf, buflen, "%s (%s)", targetname, targetipstring);
|
||||
else if (hostname)
|
||||
Snprintf(buf, buflen, "%s (%s)", hostname, targetipstring);
|
||||
} else Strncpy(buf, targetipstring, buflen);
|
||||
else
|
||||
Strncpy(buf, targetipstring, buflen);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue