From b7d16aa6766ebf1bdcdbaac96e848794c3c87f89 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 16 Jan 2008 06:26:33 +0000 Subject: * load.c (rb_feature_p): get rid of unlimited alloca. * object.c (rb_cstr_to_dbl): ditto. * io.c (mode_enc): fixed uninitialized variable. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 75c1fa302..f1ce12e86 100644 --- a/io.c +++ b/io.c @@ -3192,14 +3192,15 @@ mode_enc(rb_io_t *fptr, const char *estr) enc2name = ALLOCA_N(char, n+1); memcpy(enc2name, estr, n); enc2name[n] = '\0'; + estr = enc2name; idx2 = rb_enc_find_index(enc2name); } if (idx2 < 0) { - rb_warn("Unsupported encoding %s ignored", enc2name); + rb_warn("Unsupported encoding %.*s ignored", n, estr); } else if (idx2 == idx) { - rb_warn("Ignoring internal encoding %s: it is identical to external encoding %s", - enc2name, p1); + rb_warn("Ignoring internal encoding %.*s: it is identical to external encoding %s", + n, estr, p1); } else { fptr->enc2 = rb_enc_from_index(idx2); -- cgit