Hostname points to static area which overrides with each gethost*
call, strdup() it.
This commit is contained in:
parent
5e26f56623
commit
22cb768412
@ -393,7 +393,7 @@ main(argc, argv)
|
||||
if (hp) {
|
||||
to->sin_family = hp->h_addrtype;
|
||||
bcopy(hp->h_addr, (caddr_t)&to->sin_addr, hp->h_length);
|
||||
hostname = hp->h_name;
|
||||
hostname = strdup(hp->h_name);
|
||||
} else {
|
||||
(void)fprintf(stderr,
|
||||
"traceroute: unknown host %s\n", *argv);
|
||||
|
Loading…
Reference in New Issue
Block a user