summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/io.c b/io.c
index 01b7e2a72a..0d61e671be 100644
--- a/io.c
+++ b/io.c
@@ -2378,10 +2378,9 @@ static VALUE
rb_io_putc(io, ch)
VALUE io, ch;
{
- char c[2];
- c[0] = NUM2CHR(ch);
- c[1] = '\0';
- rb_io_write(io, rb_str_new(c, 1));
+ char c = NUM2CHR(ch);
+
+ rb_io_write(io, rb_str_new(&c, 1));
return ch;
}