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/string/strerror.c | |
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/string/strerror.c')
-rw-r--r-- | lib/libc/string/strerror.c | 8 |
1 files changed, 3 insertions, 5 deletions
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); } |