1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
eban 2001-03-26 14:29:57 +00:00
parent 253f65aa4e
commit 2559f0d90d
2 changed files with 5 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Mon Mar 26 23:19:33 2001 WATANABE Hirofumi <eban@ruby-lang.org>
* time.c (rb_strftime): check whether strftime returns empty string.
Mon Mar 26 21:16:56 2001 Shugo Maeda <shugo@ruby-lang.org> Mon Mar 26 21:16:56 2001 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb: supports response handlers and multiple commands. * lib/net/imap.rb: supports response handlers and multiple commands.

2
time.c
View file

@ -893,7 +893,7 @@ rb_strftime(buf, format, time)
return 0; return 0;
} }
len = strftime(*buf, SMALLBUF, format, time); len = strftime(*buf, SMALLBUF, format, time);
if (len != 0) return len; if (len != 0 || **buf == '\0') return len;
for (size=1024; ; size*=2) { for (size=1024; ; size*=2) {
*buf = xmalloc(size); *buf = xmalloc(size);
(*buf)[0] = '\0'; (*buf)[0] = '\0';