summaryrefslogtreecommitdiff
path: root/strftime.c
diff options
context:
space:
mode:
Diffstat (limited to 'strftime.c')
-rw-r--r--strftime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/strftime.c b/strftime.c
index 2b8033cf28..fa0e6e6a69 100644
--- a/strftime.c
+++ b/strftime.c
@@ -277,7 +277,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 || padding == (def_pad)) ? "%.*"fmt : "%*"fmt), \
+ ((padding == '0' || (!padding && def_pad == '0')) ? "%.*"fmt : "%*"fmt), \
precision, val); \
if (l < 0) goto err; \
s += l; \