diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-16 06:26:33 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-16 06:26:33 +0000 |
| commit | b7d16aa6766ebf1bdcdbaac96e848794c3c87f89 (patch) | |
| tree | 33bed36b99a8590dd8868b286423a8937419679d /io.c | |
| parent | fc4531d7fbccbdd382e329c4a73e245a25faac18 (diff) | |
| download | ruby-b7d16aa6766ebf1bdcdbaac96e848794c3c87f89.tar.gz ruby-b7d16aa6766ebf1bdcdbaac96e848794c3c87f89.tar.xz ruby-b7d16aa6766ebf1bdcdbaac96e848794c3c87f89.zip | |
* 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
Diffstat (limited to 'io.c')
| -rw-r--r-- | io.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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); |
