summaryrefslogtreecommitdiff
path: root/ext/-test-/string/set_len.c
blob: 3c7d19d77837b3b2e7ef3224150f7678b5b04c2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "ruby.h"

static VALUE
bug_str_set_len(VALUE str, VALUE len)
{
    rb_str_set_len(str, NUM2LONG(len));
    return str;
}

void
Init_set_len(VALUE klass)
{
    rb_define_method(klass, "set_len", bug_str_set_len, 1);
}