diff options
author | tjr <tjr@FreeBSD.org> | 2004-04-06 13:14:03 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2004-04-06 13:14:03 +0000 |
commit | 4212f9711ffee179c943b9f40b788b759a1ad9e6 (patch) | |
tree | 6779dc19a3df61ca545f851748ebd5f5de3a255e /lib/libc/locale/wcrtomb.c | |
parent | fcc4fa555ff7fcd7b9e4327aa717b090a18361b5 (diff) | |
download | FreeBSD-src-4212f9711ffee179c943b9f40b788b759a1ad9e6.zip FreeBSD-src-4212f9711ffee179c943b9f40b788b759a1ad9e6.tar.gz |
Prepare to handle state-dependent encodings. This mainly involves not
taking shortcuts when it comes to storing and passing around conversion
states.
Diffstat (limited to 'lib/libc/locale/wcrtomb.c')
-rw-r--r-- | lib/libc/locale/wcrtomb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libc/locale/wcrtomb.c b/lib/libc/locale/wcrtomb.c index 722e5c1..5f79949 100644 --- a/lib/libc/locale/wcrtomb.c +++ b/lib/libc/locale/wcrtomb.c @@ -34,6 +34,9 @@ extern size_t (*__wcrtomb)(char * __restrict, wchar_t, mbstate_t * __restrict); size_t wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) { + static mbstate_t mbs; + if (ps == NULL) + ps = &mbs; return (__wcrtomb(s, wc, ps)); } |