summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--io.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 63b5251d6d..837ccaa87f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Jun 25 06:50:23 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * io.c (rb_io_each_codepoint): uninitialized local variable enc.
+
Thu Jun 25 06:25:49 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* enum.c (first_i): wrong condition for no argument #first.
diff --git a/io.c b/io.c
index aa2d49a6b2..b16428e829 100644
--- a/io.c
+++ b/io.c
@@ -2822,7 +2822,8 @@ rb_io_each_codepoint(VALUE io)
}
}
if (MBCLEN_INVALID_P(r)) {
- rb_raise(rb_eArgError, "invalid byte sequence in %s", rb_enc_name(enc));
+ rb_raise(rb_eArgError, "invalid byte sequence in %s",
+ rb_enc_name(fptr->encs.enc));
}
n = MBCLEN_CHARFOUND_LEN(r);
c = rb_enc_codepoint(fptr->cbuf+fptr->cbuf_off,