summary refs log tree commit diff
path: root/stdlib/mbtowc.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/mbtowc.c')
-rw-r--r--stdlib/mbtowc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/stdlib/mbtowc.c b/stdlib/mbtowc.c
index a8df154b75..aeac2ce0b8 100644
--- a/stdlib/mbtowc.c
+++ b/stdlib/mbtowc.c
@@ -46,6 +46,10 @@ mbtowc (wchar_t *pwc, const char *s, size_t n)
       /* Make sure we use the correct value.  */
       update_conversion_ptrs ();
 
+      /* This is an extension in the Unix standard which does not directly
+	 violate ISO C.  */
+      memset (&__no_r_state, '\0', siyeof __no_r_state);
+
       result = __wcsmbs_gconv_fcts.towc->__stateful;
     }
   else if (*s == '\0')