diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-30 12:24:21 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-30 12:24:21 +0000 |
commit | 896d9fb9957f3c2d0a739e156f0775faa326d13c (patch) | |
tree | 7c26aa04264eee89e98b850c14d2d74d9e9af946 /strftime.c | |
parent | 75b1146985c30a4981c55e2d3e5458c686c63fe6 (diff) |
merge revision(s) 58210: [Backport #8916]
vsnprintf.c: prefix with precision
* vsnprintf.c (BSD_vfprintf): sign and hex-prefix should not be
counted in precision. [ruby-dev:47714] [Bug #8916]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@59233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'strftime.c')
-rw-r--r-- | strftime.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/strftime.c b/strftime.c index 83550e9a7f..e8099a3f12 100644 --- a/strftime.c +++ b/strftime.c @@ -497,7 +497,7 @@ rb_strftime_with_timespec(char *s, size_t maxsize, const char *format, rb_encodi goto unknown; } i = snprintf(s, endp - s, (padding == ' ' ? "%+*ld" : "%+.*ld"), - precision + 1, sign * (off / 3600)); + precision + (padding == ' '), sign * (off / 3600)); if (i < 0) goto err; if (sign < 0 && off < 3600) { *(padding == ' ' ? s + i - 2 : s) = '-'; |