summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/ethers.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-16 16:48:51 +0000
committerderaadt <deraadt@openbsd.org>2015-01-16 16:48:51 +0000
commitaea60bee5e9bad0aab62f480f19c2fb34c068de4 (patch)
tree1e7befbc10e28796528939427d4fdbd94b60d9af /lib/libc/net/ethers.c
parentMore evil bootstrap code. #ifndef ALIGNBYTES #define ALIGNBYTES 3. (diff)
downloadwireguard-openbsd-aea60bee5e9bad0aab62f480f19c2fb34c068de4.tar.xz
wireguard-openbsd-aea60bee5e9bad0aab62f480f19c2fb34c068de4.zip
Move to the <limits.h> universe.
review by millert, binary checking process with doug, concept with guenther
Diffstat (limited to 'lib/libc/net/ethers.c')
-rw-r--r--lib/libc/net/ethers.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/net/ethers.c b/lib/libc/net/ethers.c
index 07f1da33066..a89f0c217bf 100644
--- a/lib/libc/net/ethers.c
+++ b/lib/libc/net/ethers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ethers.c,v 1.22 2014/09/15 06:15:48 guenther Exp $ */
+/* $OpenBSD: ethers.c,v 1.23 2015/01/16 16:48:51 deraadt Exp $ */
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -27,13 +27,13 @@
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <sys/param.h>
#include <paths.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <limits.h>
#ifdef YP
#include <rpcsvc/ypclnt.h>
#endif
@@ -159,7 +159,7 @@ ether_hostton(const char *hostname, struct ether_addr *e)
{
FILE *f;
char buf[BUFSIZ+1], *p;
- char try[MAXHOSTNAMELEN];
+ char try[HOST_NAME_MAX+1];
size_t len;
#ifdef YP
int hostlen = strlen(hostname);
@@ -223,7 +223,7 @@ ether_line(const char *line, struct ether_addr *e, char *hostname)
if (*p == '\0')
goto bad;
n = strcspn(p, " \t\n");
- if (n >= MAXHOSTNAMELEN)
+ if (n >= HOST_NAME_MAX+1)
goto bad;
strlcpy(hostname, p, n + 1);
return (0);