Skip to content

Commit 14e72b1

Browse files
committed
* strftime.c (rb_strftime_with_timespec): Test yday range.
[ruby-core:44088] [Bug ruby#6247] reported by Ruby Submit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 387b420 commit 14e72b1

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Sun Apr 7 01:01:26 2013 Tanaka Akira <[email protected]>
2+
3+
* strftime.c (rb_strftime_with_timespec): Test yday range.
4+
[ruby-core:44088] [Bug #6247] reported by Ruby Submit.
5+
16
Sat Apr 6 23:46:54 2013 Naohisa Goto <[email protected]>
27

38
* configure.in (AC_CHECK_HEADERS): atomic.h for Solaris atomic_ops.

strftime.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ rb_strftime_with_timespec(char *s, size_t maxsize, const char *format, rb_encodi
363363
continue;
364364

365365
case 'j': /* day of the year, 001 - 366 */
366-
FMT('0', 3, "d", vtm->yday);
366+
i = range(1, vtm->yday, 366);
367+
FMT('0', 3, "d", (int)i);
367368
continue;
368369

369370
case 'm': /* month, 01 - 12 */

0 commit comments

Comments
 (0)