aboutsummaryrefslogtreecommitdiffstats
path: root/strftime.c
diff options
context:
space:
mode:
Diffstat (limited to 'strftime.c')
-rw-r--r--strftime.c3
1 files changed, 2 insertions, 1 deletions
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 */