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 1cf78fae5d..17f279e0ec 100644
--- a/object.c
+++ b/object.c
@@ -1044,6 +1044,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;
}