Return to commands.c CVS log | Up to [local] / src / usr.bin / telnet |
version 1.18, 1998/07/09 06:32:10 | version 1.19, 1998/07/16 18:55:59 | ||
---|---|---|---|
|
|
||
if (strchr(hbuf, '.') == 0) { | if (strchr(hbuf, '.') == 0) { | ||
struct hostent *he = gethostbyname(hbuf); | struct hostent *he = gethostbyname(hbuf); | ||
if (he != 0) | if (he != 0) | ||
strncpy(hbuf, he->h_name, sizeof hbuf); | strncpy(hbuf, he->h_name, sizeof hbuf-1); | ||
hbuf[256] = '\0'; | hbuf[sizeof hbuf-1] = '\0'; | ||
} | } | ||
asprintf (&cp, "%s%s", hbuf, cp2); | asprintf (&cp, "%s%s", hbuf, cp2); |