mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
string.c (mrb_str_len_to_dbl): should return zero for invalid string
We should not use uninitialized value; fix #6183
This commit is contained in:
+1
-1
@@ -2734,7 +2734,7 @@ bad:
|
||||
mrb_raisef(mrb, E_ARGUMENT_ERROR, "invalid string for float(%!s)", s);
|
||||
/* not reached */
|
||||
}
|
||||
return d;
|
||||
return 0.0;
|
||||
}
|
||||
if (badcheck) {
|
||||
if (!end || p == end) goto bad;
|
||||
|
||||
Reference in New Issue
Block a user