summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/string.c b/string.c
index 650d09186a..c97351c0d3 100644
--- a/string.c
+++ b/string.c
@@ -2055,12 +2055,7 @@ rb_str_s_new(int argc, VALUE *argv, VALUE klass)
}
}
- long fake_len = capa - termlen;
- if (fake_len < 0) {
- fake_len = 0;
- }
-
- VALUE str = str_new0(klass, NULL, fake_len, termlen);
+ VALUE str = str_new0(klass, NULL, capa, termlen);
STR_SET_LEN(str, 0);
TERM_FILL(RSTRING_PTR(str), termlen);