summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/object.c b/object.c
index a9f8b0297e..fa08e0ae19 100644
--- a/object.c
+++ b/object.c
@@ -1058,6 +1058,9 @@ rb_str2cstr(str, len)
str = rb_str_to_str(str);
}
if (len) *len = RSTRING(str)->len;
+ else if (ruby_verbose && RSTRING(str)->len != strlen(RSTRING(str)->ptr)) {
+ rb_warn("string contains \\0 character");
+ }
return RSTRING(str)->ptr;
}