Use StringValueCStr() to get null-terminated C-lang string
Because RSTRING_PTR() just return raw pointer in String object which might not have null-terminate in string.
It might cause a crash in magick_clone_string()
*/
#define OBJ_TO_MAGICK_STRING(f, obj) \
if ((obj) != Qnil)\
- magick_clone_string(&f, RSTRING_PTR(obj));\
+ {\
+ VALUE str = rb_String(obj);\
+ magick_clone_string(&f, StringValueCStr(str));\
+ }\
else\
f = NULL;
