From: "Iñaki Baz Castillo" Date: 2011-02-05T03:59:36+09:00 Subject: Does RSTRING_PTR() return a '\0' terminated C? Hi, in a Ruby C extension I need to get a '\0' terminated string given a Ruby string. I'm just interesed in Ruby 1.9. I'm testing that RSTRING_PTR(str) does returns a '\0' terminated string, ot it seems so, but I'm not sure. Source code says: #define RSTRING_PTR(str) \ (!(RBASIC(str)->flags & RSTRING_NOEMBED) ? \ RSTRING(str)->as.ary : \ RSTRING(str)->as.heap.ptr) Honestly, no idea about what it does :) So, can somebody ensure me that RSTRING_PTR() returns a pointer to C char finished with '\0'? Thanks a lot. -- Iñaki Baz Castillo