summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/psych/parser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/psych/parser.c b/ext/psych/parser.c
index 5f5b2537c6..f814091502 100644
--- a/ext/psych/parser.c
+++ b/ext/psych/parser.c
@@ -57,10 +57,10 @@ static VALUE parse(VALUE self, VALUE yaml)
if(rb_respond_to(yaml, id_read)) {
yaml_parser_set_input(&parser, io_reader, (void *)yaml);
} else {
- Check_Type(yaml, T_STRING);
+ StringValue(yaml);
yaml_parser_set_input_string(
&parser,
- (const unsigned char *)StringValuePtr(yaml),
+ (const unsigned char *)RSTRING_PTR(yaml),
(size_t)RSTRING_LEN(yaml)
);
}