From c3bbcd6ef65ea72fcde434bb55ca4a100f825f7c Mon Sep 17 00:00:00 2001 From: tjr Date: Wed, 7 Apr 2004 08:33:23 +0000 Subject: Begin in the initial shift state in mbstowcs() and wcstombs(). (This change is non-functional since nothing uses states yet.) --- lib/libc/locale/mbstowcs.c | 4 +++- lib/libc/locale/wcstombs.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/libc/locale/mbstowcs.c b/lib/libc/locale/mbstowcs.c index b63f1f2..1a05c7b 100644 --- a/lib/libc/locale/mbstowcs.c +++ b/lib/libc/locale/mbstowcs.c @@ -33,7 +33,9 @@ __FBSDID("$FreeBSD$"); size_t mbstowcs(wchar_t * __restrict pwcs, const char * __restrict s, size_t n) { - static mbstate_t mbs; + static const mbstate_t initial; + mbstate_t mbs; + mbs = initial; return (mbsrtowcs(pwcs, &s, n, &mbs)); } diff --git a/lib/libc/locale/wcstombs.c b/lib/libc/locale/wcstombs.c index cc5fab4..79ee279 100644 --- a/lib/libc/locale/wcstombs.c +++ b/lib/libc/locale/wcstombs.c @@ -33,7 +33,9 @@ __FBSDID("$FreeBSD$"); size_t wcstombs(char * __restrict s, const wchar_t * __restrict pwcs, size_t n) { - static mbstate_t mbs; + static const mbstate_t initial; + mbstate_t mbs; + mbs = initial; return (wcsrtombs(s, &pwcs, n, &mbs)); } -- cgit v1.1