summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/ethers.c
diff options
context:
space:
mode:
authorderaadt <>2015-01-16 16:48:51 +0000
committerderaadt <>2015-01-16 16:48:51 +0000
commit1e4765ffa2cc484d6fa2c51e54ba927cbae67f13 (patch)
tree2f04e8a0f019b4b73805acf11a1e5138c9b9f37f /src/lib/libc/net/ethers.c
parentd23934efb8e7adaa63d4eb5752505a40e4b1f285 (diff)
downloadopenbsd-1e4765ffa2cc484d6fa2c51e54ba927cbae67f13.tar.gz
openbsd-1e4765ffa2cc484d6fa2c51e54ba927cbae67f13.tar.bz2
openbsd-1e4765ffa2cc484d6fa2c51e54ba927cbae67f13.zip
Move to the <limits.h> universe.
review by millert, binary checking process with doug, concept with guenther
Diffstat (limited to 'src/lib/libc/net/ethers.c')
-rw-r--r--src/lib/libc/net/ethers.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libc/net/ethers.c b/src/lib/libc/net/ethers.c
index 07f1da3306..a89f0c217b 100644
--- a/src/lib/libc/net/ethers.c
+++ b/src/lib/libc/net/ethers.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ethers.c,v 1.22 2014/09/15 06:15:48 guenther Exp $ */ 1/* $OpenBSD: ethers.c,v 1.23 2015/01/16 16:48:51 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> 4 * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -27,13 +27,13 @@
27#include <net/if.h> 27#include <net/if.h>
28#include <netinet/in.h> 28#include <netinet/in.h>
29#include <netinet/if_ether.h> 29#include <netinet/if_ether.h>
30#include <sys/param.h>
31#include <paths.h> 30#include <paths.h>
32#include <errno.h> 31#include <errno.h>
33#include <stdio.h> 32#include <stdio.h>
34#include <stdlib.h> 33#include <stdlib.h>
35#include <string.h> 34#include <string.h>
36#include <ctype.h> 35#include <ctype.h>
36#include <limits.h>
37#ifdef YP 37#ifdef YP
38#include <rpcsvc/ypclnt.h> 38#include <rpcsvc/ypclnt.h>
39#endif 39#endif
@@ -159,7 +159,7 @@ ether_hostton(const char *hostname, struct ether_addr *e)
159{ 159{
160 FILE *f; 160 FILE *f;
161 char buf[BUFSIZ+1], *p; 161 char buf[BUFSIZ+1], *p;
162 char try[MAXHOSTNAMELEN]; 162 char try[HOST_NAME_MAX+1];
163 size_t len; 163 size_t len;
164#ifdef YP 164#ifdef YP
165 int hostlen = strlen(hostname); 165 int hostlen = strlen(hostname);
@@ -223,7 +223,7 @@ ether_line(const char *line, struct ether_addr *e, char *hostname)
223 if (*p == '\0') 223 if (*p == '\0')
224 goto bad; 224 goto bad;
225 n = strcspn(p, " \t\n"); 225 n = strcspn(p, " \t\n");
226 if (n >= MAXHOSTNAMELEN) 226 if (n >= HOST_NAME_MAX+1)
227 goto bad; 227 goto bad;
228 strlcpy(hostname, p, n + 1); 228 strlcpy(hostname, p, n + 1);
229 return (0); 229 return (0);