summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2003-05-01 19:03:14 +0000
committernectar <nectar@FreeBSD.org>2003-05-01 19:03:14 +0000
commit0b64e1476ba01c6ba095af7d0623e93362281a12 (patch)
tree736595316c161b3d1ae559f331feaa6ba12b500e /lib/libc
parent5ce8f7673e9083fdec888025823478cd3faf1ed7 (diff)
downloadFreeBSD-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')
-rw-r--r--lib/libc/gen/check_utility_compat.c9
-rw-r--r--lib/libc/gen/confstr.c5
-rw-r--r--lib/libc/gen/fmtmsg.c22
-rw-r--r--lib/libc/gen/getgrent.c4
-rw-r--r--lib/libc/gen/getpwent.c10
-rw-r--r--lib/libc/include/namespace.h2
-rw-r--r--lib/libc/include/un-namespace.h2
-rw-r--r--lib/libc/locale/setlocale.c4
-rw-r--r--lib/libc/net/getaddrinfo.c4
-rw-r--r--lib/libc/net/gethostbydns.c6
-rw-r--r--lib/libc/net/getnameinfo.c12
-rw-r--r--lib/libc/net/hesiod.c4
-rw-r--r--lib/libc/net/if_nametoindex.c2
-rw-r--r--lib/libc/nls/msgcat.c2
-rw-r--r--lib/libc/rpc/rpc_soc.c2
-rw-r--r--lib/libc/stdlib/realpath.c12
-rw-r--r--lib/libc/string/strerror.c8
-rw-r--r--lib/libc/string/strlcat.c5
-rw-r--r--lib/libc/string/strlcpy.c5
-rw-r--r--lib/libc/yp/yplib.c2
20 files changed, 51 insertions, 71 deletions
diff --git a/lib/libc/gen/check_utility_compat.c b/lib/libc/gen/check_utility_compat.c
index 2a0db43..0ccdec1 100644
--- a/lib/libc/gen/check_utility_compat.c
+++ b/lib/libc/gen/check_utility_compat.c
@@ -30,12 +30,15 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "namespace.h"
+/*
+ * I din't use "namespace.h" here because none of the relevant utilities
+ * are threaded, so I'm not concerned about cancellation points or other
+ * niceties.
+ */
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "un-namespace.h"
#ifndef LINE_MAX
#define LINE_MAX _POSIX2_LINE_MAX
@@ -52,7 +55,7 @@ check_utility_compat(const char *utility)
int len;
if ((p = getenv(_ENV_UTIL_COMPAT)) != NULL) {
- _strlcpy(buf, p, sizeof buf);
+ strlcpy(buf, p, sizeof buf);
} else {
if ((len = readlink(_PATH_UTIL_COMPAT, buf, sizeof buf)) < 0)
return 0;
diff --git a/lib/libc/gen/confstr.c b/lib/libc/gen/confstr.c
index 2885afd..966c3fe 100644
--- a/lib/libc/gen/confstr.c
+++ b/lib/libc/gen/confstr.c
@@ -37,14 +37,13 @@ static char sccsid[] = "@(#)confstr.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "namespace.h"
#include <sys/param.h>
+
#include <errno.h>
#include <limits.h>
#include <paths.h>
#include <string.h>
#include <unistd.h>
-#include "un-namespace.h"
size_t
@@ -115,7 +114,7 @@ confstr(int name, char *buf, size_t len)
docopy:
if (len != 0 && buf != NULL)
- _strlcpy(buf, p, len);
+ strlcpy(buf, p, len);
return (strlen(p) + 1);
default:
diff --git a/lib/libc/gen/fmtmsg.c b/lib/libc/gen/fmtmsg.c
index a9b4e60..6caabbb 100644
--- a/lib/libc/gen/fmtmsg.c
+++ b/lib/libc/gen/fmtmsg.c
@@ -27,12 +27,10 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "namespace.h"
#include <fmtmsg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "un-namespace.h"
/* Default value for MSGVERB. */
#define DFLT_MSGVERB "label:severity:text:action:tag"
@@ -103,13 +101,13 @@ def:
#define INSERT_COLON \
if (*output != '\0') \
- _strlcat(output, ": ", size)
+ strlcat(output, ": ", size)
#define INSERT_NEWLINE \
if (*output != '\0') \
- _strlcat(output, "\n", size)
+ strlcat(output, "\n", size)
#define INSERT_SPACE \
if (*output != '\0') \
- _strlcat(output, " ", size)
+ strlcat(output, " ", size)
/*
* Returns NULL on memory allocation failure, otherwise returns a pointer to
@@ -141,20 +139,20 @@ printfmt(char *msgverb, long class, const char *label, int sev,
while ((comp = nextcomp(msgverb)) != NULL) {
if (strcmp(comp, "label") == 0 && label != MM_NULLLBL) {
INSERT_COLON;
- _strlcat(output, label, size);
+ strlcat(output, label, size);
} else if (strcmp(comp, "severity") == 0 && sevname != NULL) {
INSERT_COLON;
- _strlcat(output, sevinfo(sev), size);
+ strlcat(output, sevinfo(sev), size);
} else if (strcmp(comp, "text") == 0 && text != MM_NULLTXT) {
INSERT_COLON;
- _strlcat(output, text, size);
+ strlcat(output, text, size);
} else if (strcmp(comp, "action") == 0 && act != MM_NULLACT) {
INSERT_NEWLINE;
- _strlcat(output, "TO FIX: ", size);
- _strlcat(output, act, size);
+ strlcat(output, "TO FIX: ", size);
+ strlcat(output, act, size);
} else if (strcmp(comp, "tag") == 0 && tag != MM_NULLTAG) {
INSERT_SPACE;
- _strlcat(output, tag, size);
+ strlcat(output, tag, size);
}
}
INSERT_NEWLINE;
@@ -173,7 +171,7 @@ nextcomp(const char *msgverb)
char *retval;
if (*lmsgverb == '\0') {
- _strlcpy(lmsgverb, msgverb, sizeof(lmsgverb));
+ strlcpy(lmsgverb, msgverb, sizeof(lmsgverb));
retval = strtok_r(lmsgverb, ":", &state);
} else {
retval = strtok_r(NULL, ":", &state);
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c
index da50574..d834d09 100644
--- a/lib/libc/gen/getgrent.c
+++ b/lib/libc/gen/getgrent.c
@@ -620,7 +620,7 @@ dns_group(void *retval, void *mdata, va_list ap)
* pointer for the member list terminator.
*/
adjsize = bufsize - _ALIGNBYTES - sizeof(char *);
- linesize = _strlcpy(buffer, hes[0], adjsize);
+ linesize = strlcpy(buffer, hes[0], adjsize);
if (linesize >= adjsize) {
*errnop = ERANGE;
rv = NS_RETURN;
@@ -721,7 +721,7 @@ nis_group(void *retval, void *mdata, va_list ap)
rv = NS_NOTFOUND;
switch (how) {
case nss_lt_name:
- if (_strlcpy(buffer, name, bufsize) >= bufsize)
+ if (strlcpy(buffer, name, bufsize) >= bufsize)
goto erange;
break;
case nss_lt_id:
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index 256595b..427a736 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -584,7 +584,7 @@ files_passwd(void *retval, void *mdata, va_list ap)
/* MAXLOGNAME includes NUL byte, but we do not
* include the NUL byte in the key.
*/
- namesize = _strlcpy(&keybuf[1], name, sizeof(keybuf)-1);
+ namesize = strlcpy(&keybuf[1], name, sizeof(keybuf)-1);
if (namesize >= sizeof(keybuf)-1) {
*errnop = EINVAL;
rv = NS_NOTFOUND;
@@ -897,7 +897,7 @@ dns_passwd(void *retval, void *mdata, va_list ap)
hes = NULL;
continue;
}
- linesize = _strlcpy(buffer, hes[0], bufsize);
+ linesize = strlcpy(buffer, hes[0], bufsize);
if (linesize >= bufsize) {
*errnop = ERANGE;
rv = NS_RETURN;
@@ -1055,7 +1055,7 @@ nis_passwd(void *retval, void *mdata, va_list ap)
rv = NS_NOTFOUND;
switch (how) {
case nss_lt_name:
- if (_strlcpy(buffer, name, bufsize) >= bufsize)
+ if (strlcpy(buffer, name, bufsize) >= bufsize)
goto erange;
break;
case nss_lt_id:
@@ -1215,7 +1215,7 @@ compat_use_template(struct passwd *pwd, struct passwd *template, char *buffer,
hold.field = NULL; \
else { \
hold.field = p; \
- p += _strlcpy(p, pwd->field, eob-p) + 1; \
+ p += strlcpy(p, pwd->field, eob-p) + 1; \
} \
} while (0)
COPY(pw_name);
@@ -1233,7 +1233,7 @@ compat_use_template(struct passwd *pwd, struct passwd *template, char *buffer,
pwd->field = NULL; \
else { \
pwd->field = p; \
- if ((n = _strlcpy(p, q, eob-p)) >= eob-p) { \
+ if ((n = strlcpy(p, q, eob-p)) >= eob-p) { \
free(copy); \
return (ERANGE); \
} \
diff --git a/lib/libc/include/namespace.h b/lib/libc/include/namespace.h
index 6a7c68d..e626200 100644
--- a/lib/libc/include/namespace.h
+++ b/lib/libc/include/namespace.h
@@ -43,8 +43,6 @@
#define err _err
#define warn _warn
#define nsdispatch _nsdispatch
-#define strlcat _strlcat
-#define strlcpy _strlcpy
/*
* Prototypes for syscalls/functions that need to be overridden
diff --git a/lib/libc/include/un-namespace.h b/lib/libc/include/un-namespace.h
index f354f78..eaa9471 100644
--- a/lib/libc/include/un-namespace.h
+++ b/lib/libc/include/un-namespace.h
@@ -149,7 +149,5 @@ int _flock(int, int);
#undef err
#undef warn
#undef nsdispatch
-#undef strlcat
-#undef strlcpy
#endif /* _UN_NAMESPACE_H_ */
diff --git a/lib/libc/locale/setlocale.c b/lib/libc/locale/setlocale.c
index ca550ae..525ca8f 100644
--- a/lib/libc/locale/setlocale.c
+++ b/lib/libc/locale/setlocale.c
@@ -41,7 +41,6 @@ static char sccsid[] = "@(#)setlocale.c 8.1 (Berkeley) 7/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "namespace.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
@@ -51,7 +50,6 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "un-namespace.h"
#include "collate.h"
#include "lmonetary.h" /* for __monetary_load_locale() */
#include "lnumeric.h" /* for __numeric_load_locale() */
@@ -182,7 +180,7 @@ setlocale(category, locale)
errno = EINVAL;
return (NULL);
}
- (void)_strlcpy(new_categories[i], locale,
+ (void)strlcpy(new_categories[i], locale,
len + 1);
i++;
locale = r;
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);
diff --git a/lib/libc/nls/msgcat.c b/lib/libc/nls/msgcat.c
index 55ed59b..4d44618 100644
--- a/lib/libc/nls/msgcat.c
+++ b/lib/libc/nls/msgcat.c
@@ -160,7 +160,7 @@ catopen(name, type)
put_tmpptr:
spcleft = sizeof(path) -
(pathP - path) - 1;
- if (_strlcpy(pathP, tmpptr, spcleft) >=
+ if (strlcpy(pathP, tmpptr, spcleft) >=
spcleft) {
too_long:
free(plang);
diff --git a/lib/libc/rpc/rpc_soc.c b/lib/libc/rpc/rpc_soc.c
index 13a68f6..9a58fc5 100644
--- a/lib/libc/rpc/rpc_soc.c
+++ b/lib/libc/rpc/rpc_soc.c
@@ -535,7 +535,7 @@ svcunix_create(sock, sendsize, recvsize, path)
memset(&sun, 0, sizeof sun);
sun.sun_family = AF_LOCAL;
- if (_strlcpy(sun.sun_path, path, sizeof(sun.sun_path)) >=
+ if (strlcpy(sun.sun_path, path, sizeof(sun.sun_path)) >=
sizeof(sun.sun_path))
goto done;
sun.sun_len = SUN_LEN(&sun);
diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c
index 93a9856..c269471 100644
--- a/lib/libc/stdlib/realpath.c
+++ b/lib/libc/stdlib/realpath.c
@@ -67,14 +67,14 @@ realpath(const char *path, char resolved[PATH_MAX])
if (path[1] == '\0')
return (resolved);
resolved_len = 1;
- left_len = _strlcpy(left, path + 1, sizeof(left));
+ left_len = strlcpy(left, path + 1, sizeof(left));
} else {
if (getcwd(resolved, PATH_MAX) == NULL) {
- _strlcpy(resolved, ".", PATH_MAX);
+ strlcpy(resolved, ".", PATH_MAX);
return (NULL);
}
resolved_len = strlen(resolved);
- left_len = _strlcpy(left, path, sizeof(left));
+ left_len = strlcpy(left, path, sizeof(left));
}
if (left_len >= sizeof(left) || resolved_len >= PATH_MAX) {
errno = ENAMETOOLONG;
@@ -131,7 +131,7 @@ realpath(const char *path, char resolved[PATH_MAX])
* lstat() fails we still can return successfully if
* there are no more path components left.
*/
- resolved_len = _strlcat(resolved, next_token, PATH_MAX);
+ resolved_len = strlcat(resolved, next_token, PATH_MAX);
if (resolved_len >= PATH_MAX) {
errno = ENAMETOOLONG;
return (NULL);
@@ -177,13 +177,13 @@ realpath(const char *path, char resolved[PATH_MAX])
symlink[slen] = '/';
symlink[slen + 1] = 0;
}
- left_len = _strlcat(symlink, left, sizeof(left));
+ left_len = strlcat(symlink, left, sizeof(left));
if (left_len >= sizeof(left)) {
errno = ENAMETOOLONG;
return (NULL);
}
}
- left_len = _strlcpy(left, symlink, sizeof(left));
+ left_len = strlcpy(left, symlink, sizeof(left));
}
}
diff --git a/lib/libc/string/strerror.c b/lib/libc/string/strerror.c
index 0c20ac3..02fba0c 100644
--- a/lib/libc/string/strerror.c
+++ b/lib/libc/string/strerror.c
@@ -37,11 +37,9 @@ static char sccsid[] = "@(#)strerror.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "namespace.h"
#include <errno.h>
#include <stdio.h>
#include <string.h>
-#include "un-namespace.h"
#define UPREFIX "Unknown error: "
@@ -71,8 +69,8 @@ errstr(int num, char *buf, size_t len)
} while (uerr /= 10);
if (num < 0)
*--t = '-';
- _strlcpy(buf, UPREFIX, len);
- _strlcat(buf, t, len);
+ strlcpy(buf, UPREFIX, len);
+ strlcat(buf, t, len);
}
int
@@ -83,7 +81,7 @@ strerror_r(int errnum, char *strerrbuf, size_t buflen)
errstr(errnum, strerrbuf, buflen);
return (EINVAL);
}
- if (_strlcpy(strerrbuf, sys_errlist[errnum], buflen) >= buflen)
+ if (strlcpy(strerrbuf, sys_errlist[errnum], buflen) >= buflen)
return (ERANGE);
return (0);
}
diff --git a/lib/libc/string/strlcat.c b/lib/libc/string/strlcat.c
index cd9fc43..2c2fa56 100644
--- a/lib/libc/string/strlcat.c
+++ b/lib/libc/string/strlcat.c
@@ -33,12 +33,9 @@ static char *rcsid = "$OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "namespace.h"
#include <sys/types.h>
#include <string.h>
-#include "un-namespace.h"
-__weak_reference(_strlcat, strlcat);
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
* full size of dst, not space left). At most siz-1 characters
@@ -47,7 +44,7 @@ __weak_reference(_strlcat, strlcat);
* If retval >= siz, truncation occurred.
*/
size_t
-_strlcat(dst, src, siz)
+strlcat(dst, src, siz)
char *dst;
const char *src;
size_t siz;
diff --git a/lib/libc/string/strlcpy.c b/lib/libc/string/strlcpy.c
index 74f511d..a8a6cb7 100644
--- a/lib/libc/string/strlcpy.c
+++ b/lib/libc/string/strlcpy.c
@@ -33,18 +33,15 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "namespace.h"
#include <sys/types.h>
#include <string.h>
-#include "un-namespace.h"
-__weak_reference(_strlcpy, strlcpy);
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred.
*/
-size_t _strlcpy(dst, src, siz)
+size_t strlcpy(dst, src, siz)
char *dst;
const char *src;
size_t siz;
diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c
index b1d5913..6087f2b 100644
--- a/lib/libc/yp/yplib.c
+++ b/lib/libc/yp/yplib.c
@@ -509,7 +509,7 @@ skipit:
*(u_short *)&ypbr.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_port;
gotit:
ysd->dom_vers = YPVERS;
- _strlcpy(ysd->dom_domain, dom, sizeof(ysd->dom_domain));
+ strlcpy(ysd->dom_domain, dom, sizeof(ysd->dom_domain));
}
/* Don't rebuild the connection to the server unless we have to. */
OpenPOWER on IntegriCloud