summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/string.c b/string.c
index 55a888b2d1..602e272763 100644
--- a/string.c
+++ b/string.c
@@ -671,6 +671,13 @@ rb_str_unlocktmp(str)
return str;
}
+void
+rb_str_set_len(VALUE str, long len)
+{
+ RSTRING(str)->len = len;
+ RSTRING(str)->ptr[len] = '\0';
+}
+
VALUE
rb_str_resize(str, len)
VALUE str;