summaryrefslogtreecommitdiffstats
path: root/usr.bin/telnet/commands.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-16 06:39:28 +0000
committerderaadt <deraadt@openbsd.org>2015-01-16 06:39:28 +0000
commitb9fc9a728fce9c4289b7e9a992665e28d5629a54 (patch)
tree72b2433e418dfa1aef5fcf8305617b97979a25d8 /usr.bin/telnet/commands.c
parentimprove checksum parsing slightly. now handles filenames with spaces. (diff)
downloadwireguard-openbsd-b9fc9a728fce9c4289b7e9a992665e28d5629a54.tar.xz
wireguard-openbsd-b9fc9a728fce9c4289b7e9a992665e28d5629a54.zip
Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
Diffstat (limited to 'usr.bin/telnet/commands.c')
-rw-r--r--usr.bin/telnet/commands.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c
index 2799f161f47..64c6e8cde8e 100644
--- a/usr.bin/telnet/commands.c
+++ b/usr.bin/telnet/commands.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commands.c,v 1.70 2014/09/09 03:41:08 guenther Exp $ */
+/* $OpenBSD: commands.c,v 1.71 2015/01/16 06:40:13 deraadt Exp $ */
/* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */
/*
@@ -47,6 +47,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#ifdef SKEY
#include <sys/wait.h>
@@ -1544,7 +1545,7 @@ env_init(void)
if ((ep = env_find("DISPLAY"))
&& ((*ep->value == ':')
|| (strncmp(ep->value, "unix:", 5) == 0))) {
- char hbuf[MAXHOSTNAMELEN];
+ char hbuf[HOST_NAME_MAX+1];
char *cp2 = strchr(ep->value, ':');
gethostname(hbuf, sizeof hbuf);
@@ -1774,7 +1775,7 @@ cmdrc(char *m1, char *m2)
int gotmachine = 0;
int l1 = strlen(m1);
int l2 = strlen(m2);
- char m1save[MAXHOSTNAMELEN];
+ char m1save[HOST_NAME_MAX+1];
if (skiprc)
return;