diff options
author | nectar <nectar@FreeBSD.org> | 2003-04-29 21:13:50 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 2003-04-29 21:13:50 +0000 |
commit | e69967f5348cec651f8806d25d2c59ac8ed8c2a2 (patch) | |
tree | e9749f1ff2693755bce73e10528fc8cc6a6563ea /lib/libc/gen/confstr.c | |
parent | 975e4bcef1ba69d85a5c90f1849accc3cd74cb65 (diff) | |
download | FreeBSD-src-e69967f5348cec651f8806d25d2c59ac8ed8c2a2.zip FreeBSD-src-e69967f5348cec651f8806d25d2c59ac8ed8c2a2.tar.gz |
`Hide' strlcpy and strlcat (using the namespace.h / __weak_reference
technique) so that we don't wind up calling into an application's
version if the application defines them.
Inspired by: qpopper's interfering and buggy version of strlcpy
Diffstat (limited to 'lib/libc/gen/confstr.c')
-rw-r--r-- | lib/libc/gen/confstr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/gen/confstr.c b/lib/libc/gen/confstr.c index 966c3fe..2885afd 100644 --- a/lib/libc/gen/confstr.c +++ b/lib/libc/gen/confstr.c @@ -37,13 +37,14 @@ 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 @@ -114,7 +115,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: |