diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-08-12 14:20:18 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-08-18 22:17:48 +0900 |
| commit | f1767fd079a74ca5c5ec77f101816b7d657509d8 (patch) | |
| tree | f74df66a1fd0ac737ece521a39746dc5a16b2843 /src/fmt_fp.c | |
| parent | 722d123b870af2a36a7ba3c0b5228b340269044b (diff) | |
| download | mruby-f1767fd079a74ca5c5ec77f101816b7d657509d8.tar.gz mruby-f1767fd079a74ca5c5ec77f101816b7d657509d8.zip | |
Separate `mrb_str_buf_new` and `mrb_str_new_capa`.
`mrb_str_buf_new` is an old function that ensures capacity size of
`MRB_STR_BUF_MIN_SIZE` minimum. Usually one need to use
`mrb_str_new_capa` instead.
Diffstat (limited to 'src/fmt_fp.c')
| -rw-r--r-- | src/fmt_fp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fmt_fp.c b/src/fmt_fp.c index 440a50071..c1c2ad703 100644 --- a/src/fmt_fp.c +++ b/src/fmt_fp.c @@ -364,7 +364,7 @@ mrb_float_to_str(mrb_state *mrb, mrb_value flo, const char *fmt) struct fmt_args f; f.mrb = mrb; - f.str = mrb_str_buf_new(mrb, 24); + f.str = mrb_str_new_capa(mrb, 24); if (fmt_core(&f, fmt, mrb_float(flo)) < 0) { mrb_raise(mrb, E_ARGUMENT_ERROR, "invalid format string"); } |
