summaryrefslogtreecommitdiffstats
path: root/time.c
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-03-26 14:29:57 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-03-26 14:29:57 +0000
commit7c5000bc2cdb78d99a02fab1496ebdef31a0e9bd (patch)
treefd5a25c91ac837396b23ad4b0227ff8ba9b10e83 /time.c
parentb23f07159a1cb434ec606cd9561e44cdc11704b9 (diff)
downloadruby-7c5000bc2cdb78d99a02fab1496ebdef31a0e9bd.tar.gz
ruby-7c5000bc2cdb78d99a02fab1496ebdef31a0e9bd.tar.xz
ruby-7c5000bc2cdb78d99a02fab1496ebdef31a0e9bd.zip
* time.c (rb_strftime): check whether strftime returns empty string.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/time.c b/time.c
index a06f1abf2..150df2da2 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';