diff options
Diffstat (limited to 'time.c')
-rw-r--r-- | time.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -4325,8 +4325,12 @@ rb_strftime_alloc(char **buf, const char *format, * if the buffer is 1024 times bigger than the length of the * format string, it's not failing for lack of room. */ - if (len > 0 || size >= 1024 * flen) break; + if (len > 0) break; xfree(*buf); + if (size >= 1024 * flen) { + rb_sys_fail(format); + break; + } } return len; } |