aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/locale/wcstombs.c
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2004-07-21 10:54:57 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2004-07-21 10:54:57 +0000
commit1949a3470f29c5edaa5fc2770c2886d653fa68d1 (patch)
tree1c3c81fbcfab80a357977aa6546dc3166c9d5257 /lib/libc/locale/wcstombs.c
parent5c0b01b42790dc2548c195c979a5053f19303411 (diff)
downloadsrc-1949a3470f29c5edaa5fc2770c2886d653fa68d1.tar.gz
src-1949a3470f29c5edaa5fc2770c2886d653fa68d1.zip
Implement the GNU extensions of mbsnrtowcs() and wcsnrtombs(). These are
convenient when the source string isn't null-terminated. Implement the other conversion functions (mbstowcs(), mbsrtowcs(), wcstombs(), wcsrtombs()) in terms of these new functions.
Notes
Notes: svn path=/head/; revision=132497
Diffstat (limited to 'lib/libc/locale/wcstombs.c')
-rw-r--r--lib/libc/locale/wcstombs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/locale/wcstombs.c b/lib/libc/locale/wcstombs.c
index 5bb5954a7cde..acd0051463b3 100644
--- a/lib/libc/locale/wcstombs.c
+++ b/lib/libc/locale/wcstombs.c
@@ -27,6 +27,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <limits.h>
#include <stdlib.h>
#include <wchar.h>
#include "mblocal.h"
@@ -38,5 +39,5 @@ wcstombs(char * __restrict s, const wchar_t * __restrict pwcs, size_t n)
mbstate_t mbs;
mbs = initial;
- return (__wcsrtombs(s, &pwcs, n, &mbs));
+ return (__wcsnrtombs(s, &pwcs, SIZE_T_MAX, n, &mbs));
}