about summary refs log tree commit diff
path: root/wcsmbs/mbsrtowcs.c
diff options
context:
space:
mode:
Diffstat (limited to 'wcsmbs/mbsrtowcs.c')
-rw-r--r--wcsmbs/mbsrtowcs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/wcsmbs/mbsrtowcs.c b/wcsmbs/mbsrtowcs.c
index cb87938e5d..dc026b7252 100644
--- a/wcsmbs/mbsrtowcs.c
+++ b/wcsmbs/mbsrtowcs.c
@@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA.  */
 #include <wchar.h>
 
 
+static mbstate_t internal;
+
 size_t
 mbsrtowcs (dst, src, len, ps)
      wchar_t *dst;
@@ -28,6 +30,10 @@ mbsrtowcs (dst, src, len, ps)
      mbstate_t *ps;
 {
   size_t result = 0;
+
+  if (ps == NULL)
+    ps = &internal;
+
   /*************************************************************\
   |* This is no complete implementation.  While the multi-byte *|
   |* character handling is not finished this will do.	       *|