summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/io.c b/io.c
index dabc6805491..5e3a48e8cec 100644
--- a/io.c
+++ b/io.c
@@ -2108,10 +2108,8 @@ void
rb_p(obj) /* for debug print within C code */
VALUE obj;
{
- obj = rb_obj_as_string(rb_inspect(obj));
- fwrite(RSTRING(obj)->ptr, 1, RSTRING(obj)->len, stdout);
- obj = rb_default_rs;
- fwrite(RSTRING(obj)->ptr, 1, RSTRING(obj)->len, stdout);
+ rb_io_write(rb_defout, rb_obj_as_string(rb_inspect(obj)));
+ rb_io_write(rb_defout, rb_default_rs);
}
static VALUE