summaryrefslogtreecommitdiff
path: root/usr.bin/telnet/commands.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-04-21 23:47:39 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-04-21 23:47:39 +0000
commit882e83ccf31fca22178b290a6753a605bb52044c (patch)
treee2e6ec6ef7e162fd03a03e5c71bc96ce90d1c105 /usr.bin/telnet/commands.c
parent67d88b0a9910a68bb666b448d2dac29cb4d3d8c2 (diff)
sync to netbsd 960418
Diffstat (limited to 'usr.bin/telnet/commands.c')
-rw-r--r--usr.bin/telnet/commands.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c
index 85e8b9daeab..769e2ee4070 100644
--- a/usr.bin/telnet/commands.c
+++ b/usr.bin/telnet/commands.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: commands.c,v 1.3 1996/03/27 19:32:58 niklas Exp $ */
-/* $NetBSD: commands.c,v 1.13 1996/02/28 21:03:53 thorpej Exp $ */
+/* $OpenBSD: commands.c,v 1.4 1996/04/21 23:44:11 deraadt Exp $ */
+/* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */
/*
* Copyright (c) 1988, 1990, 1993
@@ -37,9 +37,9 @@
#ifndef lint
#if 0
static char sccsid[] = "@(#)commands.c 8.4 (Berkeley) 5/30/95";
-static char rcsid[] = "$NetBSD: commands.c,v 1.13 1996/02/28 21:03:53 thorpej Exp $";
+static char rcsid[] = "$NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $";
#else
-static char rcsid[] = "$OpenBSD: commands.c,v 1.3 1996/03/27 19:32:58 niklas Exp $";
+static char rcsid[] = "$OpenBSD: commands.c,v 1.4 1996/04/21 23:44:11 deraadt Exp $";
#endif
#endif /* not lint */
@@ -2172,7 +2172,11 @@ tn(argc, argv)
if (temp != INADDR_NONE) {
sin.sin_addr.s_addr = temp;
sin.sin_family = AF_INET;
- (void) strcpy(_hostname, hostp);
+ host = gethostbyaddr((char *)&temp, sizeof(temp), AF_INET);
+ if (host)
+ (void) strcpy(_hostname, host->h_name);
+ else
+ (void) strcpy(_hostname, hostp);
hostname = _hostname;
} else {
host = gethostbyname(hostp);