summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fmt_fp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fmt_fp.c b/src/fmt_fp.c
index 451d691d8..cfbda570a 100644
--- a/src/fmt_fp.c
+++ b/src/fmt_fp.c
@@ -360,7 +360,10 @@ fmt_core(struct fmt_args *f, const char *fmt, mrb_float flo)
mrb_value
mrb_float_to_str(mrb_state *mrb, mrb_value flo, const char *fmt)
{
- struct fmt_args f = { mrb, mrb_str_buf_new(mrb, 24) };
+ struct fmt_args f;
+
+ f.mrb = mrb;
+ f.str = mrb_str_buf_new(mrb, 24);
if (fmt_core(&f, fmt, mrb_float(flo)) < 0) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "invalid format string");
}