summaryrefslogtreecommitdiffstats
path: root/lib/libc/locale/setlocale.c
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2003-04-29 21:13:50 +0000
committernectar <nectar@FreeBSD.org>2003-04-29 21:13:50 +0000
commite69967f5348cec651f8806d25d2c59ac8ed8c2a2 (patch)
treee9749f1ff2693755bce73e10528fc8cc6a6563ea /lib/libc/locale/setlocale.c
parent975e4bcef1ba69d85a5c90f1849accc3cd74cb65 (diff)
downloadFreeBSD-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/locale/setlocale.c')
-rw-r--r--lib/libc/locale/setlocale.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/locale/setlocale.c b/lib/libc/locale/setlocale.c
index 525ca8f..ca550ae 100644
--- a/lib/libc/locale/setlocale.c
+++ b/lib/libc/locale/setlocale.c
@@ -41,6 +41,7 @@ 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>
@@ -50,6 +51,7 @@ __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() */
@@ -180,7 +182,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;
OpenPOWER on IntegriCloud