about summary refs log tree commit diff
path: root/stdlib/wctomb.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/wctomb.c')
-rw-r--r--stdlib/wctomb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/stdlib/wctomb.c b/stdlib/wctomb.c
index 2df8b998d5..757e6adaad 100644
--- a/stdlib/wctomb.c
+++ b/stdlib/wctomb.c
@@ -42,6 +42,10 @@ wctomb (char *s, wchar_t wchar)
       /* 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);
+
       return __wcsmbs_gconv_fcts.tomb->__stateful;
     }