summaryrefslogtreecommitdiffstats
path: root/lib/libc/locale/wcsrtombs.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-05-12 14:26:54 +0000
committertjr <tjr@FreeBSD.org>2004-05-12 14:26:54 +0000
commit5ad27cd64f958bb973cd2fe0e8c9169e69168e05 (patch)
treea4b3d33fdc70e217fd81cdb660a70bd2e6e3af51 /lib/libc/locale/wcsrtombs.c
parente3f042f4aff04f73fd65f7788919c29bd71cfd1e (diff)
downloadFreeBSD-src-5ad27cd64f958bb973cd2fe0e8c9169e69168e05.zip
FreeBSD-src-5ad27cd64f958bb973cd2fe0e8c9169e69168e05.tar.gz
Reduce overhead by calling internal versions of the multibyte conversion
functions directly wherever possible.
Diffstat (limited to 'lib/libc/locale/wcsrtombs.c')
-rw-r--r--lib/libc/locale/wcsrtombs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/locale/wcsrtombs.c b/lib/libc/locale/wcsrtombs.c
index 4fa5ff8..dfc541f 100644
--- a/lib/libc/locale/wcsrtombs.c
+++ b/lib/libc/locale/wcsrtombs.c
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
+#include "mblocal.h"
size_t
wcsrtombs(char * __restrict dst, const wchar_t ** __restrict src, size_t len,
@@ -50,7 +51,7 @@ wcsrtombs(char * __restrict dst, const wchar_t ** __restrict src, size_t len,
ps = &mbs;
if (dst == NULL) {
for (;;) {
- if ((nb = (int)wcrtomb(buf, *s, ps)) < 0)
+ if ((nb = (int)__wcrtomb(buf, *s, ps)) < 0)
/* Invalid character - wcrtomb() sets errno. */
return ((size_t)-1);
else if (*s == L'\0')
@@ -64,7 +65,7 @@ wcsrtombs(char * __restrict dst, const wchar_t ** __restrict src, size_t len,
while (len > 0) {
if (len > (size_t)MB_CUR_MAX) {
/* Enough space to translate in-place. */
- if ((nb = (int)wcrtomb(dst, *s, ps)) < 0) {
+ if ((nb = (int)__wcrtomb(dst, *s, ps)) < 0) {
*src = s;
return ((size_t)-1);
}
@@ -77,7 +78,7 @@ wcsrtombs(char * __restrict dst, const wchar_t ** __restrict src, size_t len,
* character is too long for the buffer.
*/
mbsbak = *ps;
- if ((nb = (int)wcrtomb(buf, *s, ps)) < 0) {
+ if ((nb = (int)__wcrtomb(buf, *s, ps)) < 0) {
*src = s;
return ((size_t)-1);
}
OpenPOWER on IntegriCloud