aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--strftime.c4
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 <akr@fsij.org>
+
+ * strftime.c (rb_strftime_with_timespec): fix precision handling for
+ %:z and %::z.
+
Fri Jul 9 22:32:54 2010 Tanaka Akira <akr@fsij.org>
* 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;