summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-24 13:39:18 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-24 13:39:18 +0000
commitd3abc377272f16674b76d32eea9ba20b2b3eb154 (patch)
tree7cb7ecec13987f5464d22634a1779b44ab588687
parentcd8995d213fa4c459829e7d5fd412fb6834e4149 (diff)
downloadruby-d3abc377272f16674b76d32eea9ba20b2b3eb154.tar.gz
ruby-d3abc377272f16674b76d32eea9ba20b2b3eb154.tar.xz
ruby-d3abc377272f16674b76d32eea9ba20b2b3eb154.zip
* object.c (rb_cstr_to_dbl): should clear errno before calling
strtod(3). [ruby-dev:34834] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--object.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 8fbebd7b1..022756d01 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat May 24 22:32:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * object.c (rb_cstr_to_dbl): should clear errno before calling
+ strtod(3). [ruby-dev:34834]
+
Sat May 24 15:26:16 2008 Yusuke Endoh <mame@tsg.ne.jp>
* compile.c (iseq_set_exception_table, NODE_WHILE, NODE_NEXT): remove
diff --git a/object.c b/object.c
index c1c60714e..dca59471c 100644
--- a/object.c
+++ b/object.c
@@ -2045,6 +2045,7 @@ rb_cstr_to_dbl(const char *p, int badcheck)
if (!p) return 0.0;
q = p;
while (ISSPACE(*p)) p++;
+ errno = 0;
d = strtod(p, &end);
if (errno == ERANGE) {
OutOfRange();