Ensure we use gnulib mktime rather than glibc's mktime, on hosts
[gnulib.git] / lib / strftime.c
index c96cabb..1adcaa4 100644 (file)
@@ -302,7 +302,7 @@ static const CHAR_T zeroes[16] = /* "0000000000000000" */
     const char *__s = os;                                                    \
     memset (&__st, '\0', sizeof (__st));                                     \
     l = __mbsrtowcs_l (NULL, &__s, 0, &__st, loc);                           \
-    ws = alloca ((l + 1) * sizeof (wchar_t));                                \
+    ws = (wchar_t *) alloca ((l + 1) * sizeof (wchar_t));                    \
     (void) __mbsrtowcs_l (ws, &__s, l, &__st, loc);                          \
   }
 #endif
@@ -987,8 +987,8 @@ my_strftime (s, maxsize, format, tp extra_args LOCALE_PARAM)
             jump to one of these two labels.  */
 
        do_number_spacepad:
-         /* Force `_' flag unless overwritten by `0' flag.  */
-         if (pad != L_('0'))
+         /* Force `_' flag unless overridden by `0' or `-' flag.  */
+         if (pad != L_('0') && pad != L_('-'))
            pad = L_('_');
 
        do_number: