summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c
index 57b5eef9a..45ba38c9d 100644
--- a/src/string.c
+++ b/src/string.c
@@ -2057,6 +2057,7 @@ MRB_API double
mrb_cstr_to_dbl(mrb_state *mrb, const char * p, mrb_bool badcheck)
{
char *end;
+ char buf[DBL_DIG * 4 + 10];
double d;
enum {max_width = 20};
@@ -2077,7 +2078,6 @@ bad:
return d;
}
if (*end) {
- char buf[DBL_DIG * 4 + 10];
char *n = buf;
char *e = buf + sizeof(buf) - 1;
char prev = 0;