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/string/strlcat.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/string/strlcat.c')
-rw-r--r-- | lib/libc/string/strlcat.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/string/strlcat.c b/lib/libc/string/strlcat.c index 2c2fa56..cd9fc43 100644 --- a/lib/libc/string/strlcat.c +++ b/lib/libc/string/strlcat.c @@ -33,9 +33,12 @@ 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 @@ -44,7 +47,7 @@ __FBSDID("$FreeBSD$"); * If retval >= siz, truncation occurred. */ size_t -strlcat(dst, src, siz) +_strlcat(dst, src, siz) char *dst; const char *src; size_t siz; |