diff --git a/ChangeLog b/ChangeLog index 13efa805db..6aecb42f82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Apr 7 01:01:26 2013 Tanaka Akira + + * strftime.c (rb_strftime_with_timespec): Test yday range. + [ruby-core:44088] [Bug #6247] reported by Ruby Submit. + Sat Apr 6 23:46:54 2013 Naohisa Goto * configure.in (AC_CHECK_HEADERS): atomic.h for Solaris atomic_ops. diff --git a/strftime.c b/strftime.c index b05653ffd5..83550e9a7f 100644 --- a/strftime.c +++ b/strftime.c @@ -363,7 +363,8 @@ rb_strftime_with_timespec(char *s, size_t maxsize, const char *format, rb_encodi continue; case 'j': /* day of the year, 001 - 366 */ - FMT('0', 3, "d", vtm->yday); + i = range(1, vtm->yday, 366); + FMT('0', 3, "d", (int)i); continue; case 'm': /* month, 01 - 12 */