From d06a6b22f59012399236597101dafbba7a884f70 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 10 Jul 2010 12:43:54 +0000 Subject: * strftime.c (rb_strftime_with_timespec): fix precision handling for %:z and %::z. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ strftime.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bbd88495d1..290ea80f5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Jul 10 21:43:11 2010 Tanaka Akira + + * strftime.c (rb_strftime_with_timespec): fix precision handling for + %:z and %::z. + Fri Jul 9 22:32:54 2010 Tanaka Akira * strftime.c: unused declarations removed. diff --git a/strftime.c b/strftime.c index c390d2b6e0..3bdf7f6ecf 100644 --- a/strftime.c +++ b/strftime.c @@ -451,12 +451,12 @@ rb_strftime_with_timespec(char *s, size_t maxsize, const char *format, const str break; case 1: /* %:z -> +hh:mm */ - precision = precision <= 5 ? 2 : precision-3; + precision = precision <= 6 ? 2 : precision-4; NEEDS(precision + 4); break; case 2: /* %::z -> +hh:mm:ss */ - precision = precision <= 5 ? 2 : precision-3; + precision = precision <= 9 ? 2 : precision-7; NEEDS(precision + 7); break; -- cgit v1.2.3