diff options
author | nagachika <nagachika@ruby-lang.org> | 2020-07-25 11:56:28 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2020-07-25 11:56:28 +0900 |
commit | 2e9626fddd168bd12352b4f5dc3412c6a33ce44e (patch) | |
tree | 89c00c55ed227593fe0601a1bbdf9cc0d6d7102d /strftime.c | |
parent | c65aae118ccff86096b9983641b371491bc23434 (diff) |
merge revision(s) 2f1895fa15386fb3cdc91c5604171290828b9da8: [Backport #16767]
Fixed formatted substring expansion [Bug #16767]
Diffstat (limited to 'strftime.c')
-rw-r--r-- | strftime.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/strftime.c b/strftime.c index dd2b21f977..446be7d338 100644 --- a/strftime.c +++ b/strftime.c @@ -326,7 +326,9 @@ rb_strftime_with_timespec(VALUE ftime, const char *format, size_t format_len, s += len; \ if (i > 0) case_conv(s, i, flags); \ if (precision > i) {\ + s += i; \ NEEDS(precision); \ + s -= i; \ memmove(s + precision - i, s, i);\ memset(s, padding ? padding : ' ', precision - i); \ s += precision; \ |