Ruby  1.9.3p429(2013-05-15revision40747)
cstr.c
Go to the documentation of this file.
1 #include "ruby.h"
2 
3 static VALUE
5 {
6  long len;
7  char *s;
8  rb_str_modify(str);
9  len = RSTRING_LEN(str);
10  RSTRING_PTR(str)[len] = 'x';
11  s = StringValueCStr(str);
12  rb_gc();
13  return INT2NUM(s[len]);
14 }
15 
16 void
18 {
19  rb_define_method(klass, "cstr_term", bug_str_cstr_term, 0);
20 }
21