diff --git a/appl/telnet/telnet/commands.c b/appl/telnet/telnet/commands.c index d69ec337e..129e8f29d 100644 --- a/appl/telnet/telnet/commands.c +++ b/appl/telnet/telnet/commands.c @@ -2143,6 +2143,7 @@ tn(int argc, char **argv) host = gethostbyname(hostp); #endif if (host) { + strncpy(_hostname, host->h_name, sizeof(_hostname)); family = host->h_addrtype; switch(family) {