Unverified Commit ef644120 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4856 from shuujii/fix-the-error-message-of-Kernel-Float

Fix the error message of `Kernel#Float`
parents 2456d3ab cf6ae0de
...@@ -2492,8 +2492,9 @@ mrb_str_to_i(mrb_state *mrb, mrb_value self) ...@@ -2492,8 +2492,9 @@ mrb_str_to_i(mrb_state *mrb, mrb_value self)
#ifndef MRB_WITHOUT_FLOAT #ifndef MRB_WITHOUT_FLOAT
MRB_API double MRB_API double
mrb_cstr_to_dbl(mrb_state *mrb, const char * p, mrb_bool badcheck) mrb_cstr_to_dbl(mrb_state *mrb, const char * s, mrb_bool badcheck)
{ {
const char *p = s;
char *end; char *end;
char buf[DBL_DIG * 4 + 10]; char buf[DBL_DIG * 4 + 10];
double d; double d;
...@@ -2508,7 +2509,7 @@ mrb_cstr_to_dbl(mrb_state *mrb, const char * p, mrb_bool badcheck) ...@@ -2508,7 +2509,7 @@ mrb_cstr_to_dbl(mrb_state *mrb, const char * p, mrb_bool badcheck)
if (p == end) { if (p == end) {
if (badcheck) { if (badcheck) {
bad: bad:
mrb_raisef(mrb, E_ARGUMENT_ERROR, "invalid string for float(%s)", p); mrb_raisef(mrb, E_ARGUMENT_ERROR, "invalid string for float(%!s)", s);
/* not reached */ /* not reached */
} }
return d; return d;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment