summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
Diffstat (limited to 're.c')
-rw-r--r--re.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/re.c b/re.c
index c061ef9e2f..504c1d2435 100644
--- a/re.c
+++ b/re.c
@@ -1806,9 +1806,7 @@ match_inspect(VALUE match)
if (names[i].name)
rb_str_buf_cat(str, (const char *)names[i].name, names[i].len);
else {
- char buf[sizeof(i)*3+1];
- snprintf(buf, sizeof(buf), "%d", i);
- rb_str_buf_cat2(str, buf);
+ rb_str_catf(str, "%d", i);
}
rb_str_buf_cat2(str, ":");
}