Correctly print out "Connected to" hostname.
Temporal buffer was used for the hostname and freed before actually used. Specified by: ru Approved by: jkh
This commit is contained in:
parent
c9f2d5f483
commit
88a845c11d
@ -134,10 +134,9 @@ hookup(host0, port)
|
||||
}
|
||||
|
||||
res = res0;
|
||||
if (res->ai_canonname)
|
||||
hostname = res->ai_canonname;
|
||||
else {
|
||||
(void) strncpy(hostnamebuf, host, sizeof(hostnamebuf));
|
||||
if (res->ai_canonname) {
|
||||
(void) strncpy(hostnamebuf, res->ai_canonname,
|
||||
sizeof(hostnamebuf));
|
||||
hostname = hostnamebuf;
|
||||
}
|
||||
while (1) {
|
||||
|
Loading…
Reference in New Issue
Block a user