X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58..2be56ee90c5c5bee77895b8787a43e894249002b:/locale/FreeBSD/wcstombs.c diff --git a/locale/FreeBSD/wcstombs.c b/locale/FreeBSD/wcstombs.c index c7d5b67..a6d9ae3 100644 --- a/locale/FreeBSD/wcstombs.c +++ b/locale/FreeBSD/wcstombs.c @@ -27,19 +27,29 @@ #include __FBSDID("$FreeBSD: src/lib/libc/locale/wcstombs.c,v 1.11 2009/01/15 18:53:52 rdivacky Exp $"); +#include "xlocale_private.h" + #include #include #include #include "mblocal.h" size_t -wcstombs(char * __restrict s, const wchar_t * __restrict pwcs, size_t n) +wcstombs_l(char * __restrict s, const wchar_t * __restrict pwcs, size_t n, + locale_t loc) { static const mbstate_t initial; mbstate_t mbs; const wchar_t *pwcsp; + NORMALIZE_LOCALE(loc); mbs = initial; pwcsp = pwcs; - return (__wcsnrtombs(s, &pwcsp, SIZE_T_MAX, n, &mbs)); + return (loc->__lc_ctype->__wcsnrtombs(s, &pwcsp, SIZE_T_MAX, n, &mbs, loc)); +} + +size_t +wcstombs(char * __restrict s, const wchar_t * __restrict pwcs, size_t n) +{ + return wcstombs_l(s, pwcs, n, __current_locale()); }