mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
numeric.c (mrb_float_to_str): avoid memcpy()
This commit is contained in:
+2
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user