mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
readfloat.c (mrb_read_float): a new function.
We no longer use `mrb_float_read()` that depends on `errno`.
This commit is contained in:
+1
-2
@@ -2572,8 +2572,7 @@ mrb_str_len_to_dbl(mrb_state *mrb, const char *s, size_t len, mrb_bool badcheck)
|
||||
p = buf;
|
||||
pend = n;
|
||||
nocopy:
|
||||
d = mrb_float_read(p, &end);
|
||||
if (p == end) {
|
||||
if (mrb_read_float(p, &end, &d) == FALSE) {
|
||||
if (badcheck) {
|
||||
bad:
|
||||
mrb_raisef(mrb, E_ARGUMENT_ERROR, "invalid string for float(%!s)", s);
|
||||
|
||||
Reference in New Issue
Block a user