[%S]: Don't clear mbstate twice; wcsrtombs must put it into initial state.
authordrepper <drepper>
Wed, 29 Apr 1998 09:11:27 +0000 (09:11 +0000)
committerdrepper <drepper>
Wed, 29 Apr 1998 09:11:27 +0000 (09:11 +0000)
stdio-common/vfprintf.c

index d8d0f87..dcc5cdb 100644 (file)
@@ -887,9 +887,9 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
              /* Illegal wide-character string.  */                           \
              return -1;                                                      \
                                                                              \
+           assert (__mbsinit (&mbstate));                                    \
            s2 = (const wchar_t *) string;                                    \
            string = alloca (len + 1);                                        \
-           memset (&mbstate, '\0', sizeof (mbstate_t));                      \
            (void) __wcsrtombs (string, &s2, prec != -1 ? prec : UINT_MAX,    \
                                &mbstate);                                    \
          }                                                                   \