From 8707a6ff4b380790549aee1d7c6f023461580f6c Mon Sep 17 00:00:00 2001 From: matz Date: Sat, 24 May 2008 13:39:18 +0000 Subject: [PATCH] * object.c (rb_cstr_to_dbl): should clear errno before calling strtod(3). [ruby-dev:34834] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ object.c | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8fbebd7b1f..022756d010 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat May 24 22:32:49 2008 Yukihiro Matsumoto + + * 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 * compile.c (iseq_set_exception_table, NODE_WHILE, NODE_NEXT): remove diff --git a/object.c b/object.c index c1c60714e2..dca59471ce 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();