summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-io/src/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/mruby-io/src/io.c')
-rw-r--r--mrbgems/mruby-io/src/io.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mrbgems/mruby-io/src/io.c b/mrbgems/mruby-io/src/io.c
index b28223f36..7d620a6a7 100644
--- a/mrbgems/mruby-io/src/io.c
+++ b/mrbgems/mruby-io/src/io.c
@@ -1446,8 +1446,10 @@ static mrb_value
mrb_io_readchar(mrb_state *mrb, mrb_value self)
{
mrb_value buf;
- unsigned char c;
mrb_int len = 1;
+#ifdef MRB_UTF8_STRING
+ unsigned char c;
+#endif
mrb_get_args(mrb, "S", &buf);
mrb_assert(RSTRING_PTR(buf) > 0);