aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-18 01:23:00 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-18 01:23:00 +0000
commit442fefc78ac5230bda2c2fd78b9375091bcf193f (patch)
treecbcf69b6f6ca3d284795339f445d2ce5af4fdc2b
parent9e56e14f50d6b9de3654538af7a44f1f6ac8894f (diff)
downloadruby-442fefc78ac5230bda2c2fd78b9375091bcf193f.tar.gz
* strftime.c (rb_strftime_with_timespec): add an interim digit for
the timezone offset which is less than an hour. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--strftime.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d010426fd..122c456574 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Apr 18 10:22:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * strftime.c (rb_strftime_with_timespec): add an interim digit for
+ the timezone offset which is less than an hour.
+
Wed Apr 18 09:58:29 2012 Eric Hodel <drbrain@segment7.net>
* lib/rubygems/version.rb: Fixed init_with warning by calling into
diff --git a/strftime.c b/strftime.c
index 3a50e55fbd..ea369deaa0 100644
--- a/strftime.c
+++ b/strftime.c
@@ -493,9 +493,9 @@ rb_strftime_with_timespec(char *s, size_t maxsize, const char *format, rb_encodi
sign = +1;
}
i = snprintf(s, endp - s, (padding == ' ' ? "%+*ld" : "%+.*ld"),
- precision + 1, sign * (off / 3600));
+ precision + 2, sign * (off / 360 + 1));
if (i < 0) goto err;
- s += i;
+ s += i - 1;
off = off % 3600;
if (1 <= colons)
*s++ = ':';