diff options
author | nectar <nectar@FreeBSD.org> | 2003-05-01 19:03:14 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 2003-05-01 19:03:14 +0000 |
commit | 0b64e1476ba01c6ba095af7d0623e93362281a12 (patch) | |
tree | 736595316c161b3d1ae559f331feaa6ba12b500e /lib/libc/net | |
parent | 5ce8f7673e9083fdec888025823478cd3faf1ed7 (diff) | |
download | FreeBSD-src-0b64e1476ba01c6ba095af7d0623e93362281a12.zip FreeBSD-src-0b64e1476ba01c6ba095af7d0623e93362281a12.tar.gz |
Back out the `hiding' of strlcpy and strlcat. Several people
vocally objected to this safety belt.
Diffstat (limited to 'lib/libc/net')
-rw-r--r-- | lib/libc/net/getaddrinfo.c | 4 | ||||
-rw-r--r-- | lib/libc/net/gethostbydns.c | 6 | ||||
-rw-r--r-- | lib/libc/net/getnameinfo.c | 12 | ||||
-rw-r--r-- | lib/libc/net/hesiod.c | 4 | ||||
-rw-r--r-- | lib/libc/net/if_nametoindex.c | 2 |
5 files changed, 11 insertions, 17 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index 2b8708a..e2cb71a 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -853,7 +853,7 @@ get_canonname(pai, ai, str) ai->ai_canonname = (char *)malloc(strlen(str) + 1); if (ai->ai_canonname == NULL) return EAI_MEMORY; - _strlcpy(ai->ai_canonname, str, strlen(str) + 1); + strlcpy(ai->ai_canonname, str, strlen(str) + 1); } return 0; } @@ -1305,7 +1305,7 @@ getanswer(answer, anslen, qname, qtype, pai) had_error++; continue; } - _strlcpy(bp, tbuf, ep - bp); + strlcpy(bp, tbuf, ep - bp); canonname = bp; bp += n; continue; diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c index 9eeba2f..02cd223 100644 --- a/lib/libc/net/gethostbydns.c +++ b/lib/libc/net/gethostbydns.c @@ -60,7 +60,6 @@ static char fromrcsid[] = "From: Id: gethnamaddr.c,v 8.23 1998/04/07 04:59:46 vi #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "namespace.h" #include <sys/types.h> #include <sys/param.h> #include <sys/socket.h> @@ -79,7 +78,6 @@ __FBSDID("$FreeBSD$"); #include <syslog.h> #include <stdarg.h> #include <nsswitch.h> -#include "un-namespace.h" #include "res_config.h" @@ -676,7 +674,7 @@ _dns_gethostbyaddr(void *rval, void *cb_data, va_list ap) uaddr[n] & 0xf, (uaddr[n] >> 4) & 0xf)); } - _strlcat(qbuf, "ip6.arpa", sizeof(qbuf)); + strlcat(qbuf, "ip6.arpa", sizeof(qbuf)); break; default: abort(); @@ -688,7 +686,7 @@ _dns_gethostbyaddr(void *rval, void *cb_data, va_list ap) n = res_query(qbuf, C_IN, T_PTR, (u_char *)buf->buf, sizeof buf->buf); if (n < 0 && af == AF_INET6) { *qp = '\0'; - _strlcat(qbuf, "ip6.int", sizeof(qbuf)); + strlcat(qbuf, "ip6.int", sizeof(qbuf)); n = res_query(qbuf, C_IN, T_PTR, (u_char *)buf->buf, sizeof buf->buf); } diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c index 1aec5be..cee07f6 100644 --- a/lib/libc/net/getnameinfo.c +++ b/lib/libc/net/getnameinfo.c @@ -46,7 +46,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "namespace.h" #include <sys/types.h> #include <sys/socket.h> #include <net/if.h> @@ -58,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <stddef.h> #include <errno.h> -#include "un-namespace.h" static const struct afd { int a_af; @@ -147,12 +145,12 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) if (sp) { if (strlen(sp->s_name) + 1 > servlen) return EAI_MEMORY; - _strlcpy(serv, sp->s_name, servlen); + strlcpy(serv, sp->s_name, servlen); } else { snprintf(numserv, sizeof(numserv), "%u", ntohs(port)); if (strlen(numserv) + 1 > servlen) return EAI_MEMORY; - _strlcpy(serv, numserv, servlen); + strlcpy(serv, numserv, servlen); } } @@ -225,7 +223,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) numaddrlen = strlen(numaddr); if (numaddrlen + 1 > hostlen) /* don't forget terminator */ return EAI_MEMORY; - _strlcpy(host, numaddr, hostlen); + strlcpy(host, numaddr, hostlen); break; } } else { @@ -248,7 +246,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) freehostent(hp); return EAI_MEMORY; } - _strlcpy(host, hp->h_name, hostlen); + strlcpy(host, hp->h_name, hostlen); freehostent(hp); } else { if (flags & NI_NAMEREQD) @@ -295,7 +293,7 @@ ip6_parsenumeric(sa, addr, host, hostlen, flags) numaddrlen = strlen(numaddr); if (numaddrlen + 1 > hostlen) /* don't forget terminator */ return EAI_MEMORY; - _strlcpy(host, numaddr, hostlen); + strlcpy(host, numaddr, hostlen); if (((const struct sockaddr_in6 *)sa)->sin6_scope_id) { char zonebuf[MAXHOSTNAMELEN]; diff --git a/lib/libc/net/hesiod.c b/lib/libc/net/hesiod.c index 214f86e..c22bdba 100644 --- a/lib/libc/net/hesiod.c +++ b/lib/libc/net/hesiod.c @@ -51,7 +51,6 @@ static char *orig_rcsid = "$NetBSD: hesiod.c,v 1.9 1999/02/11 06:16:38 simonb Ex #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include "namespace.h" #include <sys/types.h> #include <sys/param.h> #include <netinet/in.h> @@ -65,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include <stdlib.h> #include <string.h> #include <unistd.h> -#include "un-namespace.h" struct hesiod_p { char *lhs; /* normally ".ns" */ @@ -165,7 +163,7 @@ hesiod_to_bind(void *context, const char *name, const char *type) const char *rhs; int len; - if (_strlcpy(bindname, name, sizeof(bindname)) >= sizeof(bindname)) { + if (strlcpy(bindname, name, sizeof(bindname)) >= sizeof(bindname)) { errno = EMSGSIZE; return NULL; } diff --git a/lib/libc/net/if_nametoindex.c b/lib/libc/net/if_nametoindex.c index 887d64f..d0ca521 100644 --- a/lib/libc/net/if_nametoindex.c +++ b/lib/libc/net/if_nametoindex.c @@ -70,7 +70,7 @@ if_nametoindex(const char *ifname) s = _socket(AF_INET, SOCK_DGRAM, 0); if (s != -1) { - _strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); if (_ioctl(s, SIOCGIFINDEX, &ifr) != -1) { _close(s); return (ifr.ifr_index); |