summaryrefslogtreecommitdiff
path: root/ext/psych/psych_emitter.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/psych_emitter.c')
-rw-r--r--ext/psych/psych_emitter.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/psych/psych_emitter.c b/ext/psych/psych_emitter.c
index 2154470..55bd417 100644
--- a/ext/psych/psych_emitter.c
+++ b/ext/psych/psych_emitter.c
@@ -192,8 +192,8 @@ static VALUE start_document(VALUE self, VALUE version, VALUE tags, VALUE imp)
name = rb_str_export_to_enc(name, encoding);
value = rb_str_export_to_enc(value, encoding);
- tail->handle = (yaml_char_t *)RSTRING_PTR(name);
- tail->prefix = (yaml_char_t *)RSTRING_PTR(value);
+ tail->handle = (yaml_char_t *)StringValueCStr(name);
+ tail->prefix = (yaml_char_t *)StringValueCStr(value);
tail++;
}
@@ -272,8 +272,8 @@ static VALUE scalar(
yaml_scalar_event_initialize(
&event,
- (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValuePtr(anchor)),
- (yaml_char_t *)(NIL_P(tag) ? NULL : StringValuePtr(tag)),
+ (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValueCStr(anchor)),
+ (yaml_char_t *)(NIL_P(tag) ? NULL : StringValueCStr(tag)),
(yaml_char_t*)StringValuePtr(value),
(int)RSTRING_LEN(value),
plain ? 1 : 0,
@@ -319,8 +319,8 @@ static VALUE start_sequence(
yaml_sequence_start_event_initialize(
&event,
- (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValuePtr(anchor)),
- (yaml_char_t *)(NIL_P(tag) ? NULL : StringValuePtr(tag)),
+ (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValueCStr(anchor)),
+ (yaml_char_t *)(NIL_P(tag) ? NULL : StringValueCStr(tag)),
implicit ? 1 : 0,
(yaml_sequence_style_t)NUM2INT(style)
);
@@ -383,8 +383,8 @@ static VALUE start_mapping(
yaml_mapping_start_event_initialize(
&event,
- (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValuePtr(anchor)),
- (yaml_char_t *)(NIL_P(tag) ? NULL : StringValuePtr(tag)),
+ (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValueCStr(anchor)),
+ (yaml_char_t *)(NIL_P(tag) ? NULL : StringValueCStr(tag)),
implicit ? 1 : 0,
(yaml_mapping_style_t)NUM2INT(style)
);
@@ -432,7 +432,7 @@ static VALUE alias(VALUE self, VALUE anchor)
yaml_alias_event_initialize(
&event,
- (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValuePtr(anchor))
+ (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValueCStr(anchor))
);
emit(emitter, &event);