fmt_fp.c: use constant that depends on `mrb_float` size.

parent 5ed3a347
......@@ -201,8 +201,8 @@ mrb_format_float(mrb_float f, char *buf, size_t buf_size, char fmt, int prec, ch
e_sign = e_sign_char;
dec = 0;
if (prec > (buf_remaining - 6)) {
prec = buf_remaining - 6;
if (prec > (buf_remaining - FLT_MIN_BUF_SIZE)) {
prec = buf_remaining - FLT_MIN_BUF_SIZE;
if (fmt == 'g') {
prec++;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment