about summary refs log tree commit diff
path: root/stdio-common/vfprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/vfprintf.c')
-rw-r--r--stdio-common/vfprintf.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index 8031b99ae9..3fa53a62a8 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -735,16 +735,14 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
 	else								      \
 	  {								      \
 	    const wchar_t *s2 = (const wchar_t *) string;		      \
-	    mbstate_t mbstate = 0;					      \
+	    mbstate_t mbstate;						      \
 									      \
-	    len = wcsrtombs (NULL, &s2, prec != -1 ? prec : UINT_MAX,	      \
-			     &mbstate);					      \
+	    len = wcsrtombs (NULL, &s2, 0, &mbstate);			      \
 	    if (len == (size_t) -1)					      \
 	      /* Illegal wide-character string.  */			      \
 	      return -1;						      \
 									      \
 	    s2 = (const wchar_t *) string;				      \
-	    mbstate = 0;						      \
 	    string = alloca (len + 1);					      \
 	    (void) wcsrtombs (string, &s2, prec != -1 ? prec : UINT_MAX,      \
 			      &mbstate);				      \
@@ -841,7 +839,6 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
   /* Initialize local variables.  */
   done = 0;
   grouping = (const char *) -1;
-  mbstate = 0;
   ap_save = ap;
   nspecs_done = 0;