diff options
Diffstat (limited to 'wcsmbs/mbrtowc.c')
-rw-r--r-- | wcsmbs/mbrtowc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/wcsmbs/mbrtowc.c b/wcsmbs/mbrtowc.c index 17083196bd..2c4b0779da 100644 --- a/wcsmbs/mbrtowc.c +++ b/wcsmbs/mbrtowc.c @@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA. */ #include <wchar.h> +static mbstate_t internal; + size_t mbrtowc (pwc, s, n, ps) wchar_t *pwc; @@ -29,6 +31,9 @@ mbrtowc (pwc, s, n, ps) { wchar_t to_wide; + if (ps == NULL) + ps = &internal; + /*************************************************************\ |* This is no complete implementation. While the multi-byte *| |* character handling is not finished this will do. *| |