aboutsummaryrefslogtreecommitdiffstats
path: root/strftime.c
diff options
context:
space:
mode:
Diffstat (limited to 'strftime.c')
-rw-r--r--strftime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/strftime.c b/strftime.c
index d6d1f8bd3a..98e193c396 100644
--- a/strftime.c
+++ b/strftime.c
@@ -286,7 +286,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
if (precision <= 0) precision = (def_prec); \
if (flags & BIT_OF(LEFT)) precision = 1; \
l = snprintf(s, endp - s, \
- ((padding == '0' || (!padding && def_pad == '0')) ? "%.*"fmt : "%*"fmt), \
+ ((padding == '0' || (!padding && def_pad == '0')) ? "%0*"fmt : "%*"fmt), \
precision, val); \
if (l < 0) goto err; \
s += l; \
@@ -417,7 +417,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
break;
case 's':
- FMT(' ', 1, "d", (int) ts->tv_sec);
+ FMT('0', 1, "d", (int) ts->tv_sec);
continue;
case 'S': /* second, 00 - 60 */