From ab67d5864e0df8affa5c02df1a523006ab312ca2 Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 12 Sep 2008 17:53:26 +0000 Subject: * transcode.c (rb_econv_prepare_opts): initialize *opt and return 0 if opthash is nil. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- transcode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'transcode.c') diff --git a/transcode.c b/transcode.c index 3dfca27d0..e7c66ff42 100644 --- a/transcode.c +++ b/transcode.c @@ -2304,8 +2304,10 @@ rb_econv_prepare_opts(VALUE opthash, VALUE *opts) { int ecflags; VALUE newhash = Qnil; - if (NIL_P(opthash)) - return Qnil; + if (NIL_P(opthash)) { + *opts = Qnil; + return 0; + } ecflags = econv_opts(opthash); if ((ecflags & ECONV_INVALID_MASK) == ECONV_INVALID_REPLACE || -- cgit