summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index 3449ce6b53..48718f93ac 100644
--- a/string.c
+++ b/string.c
@@ -2006,8 +2006,8 @@ rb_str_format_m(VALUE str, VALUE arg)
VALUE tmp = rb_check_array_type(arg);
if (!NIL_P(tmp)) {
- VALUE rv = rb_str_format(RARRAY_LENINT(tmp), RARRAY_CONST_PTR(tmp), str);
- RB_GC_GUARD(tmp);
+ const long len = RARRAY_LENINT(tmp);
+ VALUE rv = rb_str_format(len, RARRAY_CONST_PTR(tmp), str);
return rv;
}
return rb_str_format(1, &arg, str);