From 54524ed8f036f993c0a2acd4b671783daa774d86 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 22 Dec 2003 12:59:28 +0000 Subject: * ext/iconv/iconv.c (map_charset): always ensure code is a String. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/iconv/iconv.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'ext') diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 1ef2a51b1b..4b1f4b5073 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -113,14 +113,10 @@ map_charset VALUE key = rb_funcall2(val, rb_intern("downcase"), 0, 0); StringValuePtr(key); if (st_lookup(RHASH(charset_map)->tbl, key, &val)) { - StringValuePtr(val); *code = val; } } - else { - StringValuePtr(val); - } - return RSTRING(val)->ptr; + return StringValuePtr(*code); } static iconv_t -- cgit v1.2.3