From 2559f0d90ddf45f6cbaadc69a7a2fd7a3bfbf8a0 Mon Sep 17 00:00:00 2001 From: eban Date: Mon, 26 Mar 2001 14:29:57 +0000 Subject: * time.c (rb_strftime): check whether strftime returns empty string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ time.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f8c1d13d97..63a7e346d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Mar 26 23:19:33 2001 WATANABE Hirofumi + + * time.c (rb_strftime): check whether strftime returns empty string. + Mon Mar 26 21:16:56 2001 Shugo Maeda * lib/net/imap.rb: supports response handlers and multiple commands. diff --git a/time.c b/time.c index a06f1abf2a..150df2da2f 100644 --- a/time.c +++ b/time.c @@ -893,7 +893,7 @@ rb_strftime(buf, format, time) return 0; } len = strftime(*buf, SMALLBUF, format, time); - if (len != 0) return len; + if (len != 0 || **buf == '\0') return len; for (size=1024; ; size*=2) { *buf = xmalloc(size); (*buf)[0] = '\0'; -- cgit v1.2.3