summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-16 18:56:00 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-16 18:56:00 +0000
commit88e7a143daa7d630085cb7620870bd2858d567ee (patch)
tree942c3ea25a830a7f0e3953bab04f00602853dffd
parent0e77c4a98e4ee411bdadc1afad2aa07c9ef8f137 (diff)
terminate nicer
-rw-r--r--usr.bin/telnet/commands.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c
index 4ae1ec117d6..3168ae93999 100644
--- a/usr.bin/telnet/commands.c
+++ b/usr.bin/telnet/commands.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commands.c,v 1.18 1998/07/09 06:32:10 deraadt Exp $ */
+/* $OpenBSD: commands.c,v 1.19 1998/07/16 18:55:59 deraadt Exp $ */
/* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */
/*
@@ -1676,8 +1676,8 @@ env_init()
if (strchr(hbuf, '.') == 0) {
struct hostent *he = gethostbyname(hbuf);
if (he != 0)
- strncpy(hbuf, he->h_name, sizeof hbuf);
- hbuf[256] = '\0';
+ strncpy(hbuf, he->h_name, sizeof hbuf-1);
+ hbuf[sizeof hbuf-1] = '\0';
}
asprintf (&cp, "%s%s", hbuf, cp2);