summaryrefslogtreecommitdiff
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
commit97101e1a65cdea02e26cfa0e752d62bb87f6b162 (patch)
tree85978c1a35bcdd957e15c03e983f146971dcdc0b /time.c
parenta4918f7cc5205671e60082f949aaf3a0fcafd733 (diff)
* time.c (rb_strftime): check whether strftime returns empty string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@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 e45e2e854a..f4a11cd245 100644
--- a/time.c
+++ b/time.c
@@ -891,7 +891,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';