numeric.c (mrb_float_to_str): avoid memcpy()

This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-07-21 21:14:42 +09:00
parent 0eceadd037
commit 5d0016186f
+2 -1
View File
@@ -354,7 +354,8 @@ mrb_float_to_str(mrb_state *mrb, mrb_value flo, const char *fmt)
if (*p == '.') goto exit;
if (*p == 'e') {
memmove(p+2, p, strlen(p)+1);
memcpy(p, ".0", 2);
p[0] = '.';
p[1] = '0';
goto exit;
}
}