ruby-changes:15441
From: nobu <ko1@a...>
Date: Wed, 14 Apr 2010 17:54:02 +0900 (JST)
Subject: [ruby-changes:15441] Ruby:r27339 (ruby_1_8): * io.c (appendline): should terminate.
nobu 2010-04-14 17:53:49 +0900 (Wed, 14 Apr 2010) New Revision: 27339 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27339 Log: * io.c (appendline): should terminate. http://golf.shinh.org/p.rb?DECimal+number+to+BINary#Ruby Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/io.c Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 27338) +++ ruby_1_8/ChangeLog (revision 27339) @@ -1,5 +1,8 @@ -Wed Apr 14 15:58:11 2010 Nobuyoshi Nakada <nobu@r...> +Wed Apr 14 17:53:44 2010 Nobuyoshi Nakada <nobu@r...> + * io.c (appendline): should terminate. + http://golf.shinh.org/p.rb?DECimal+number+to+BINary#Ruby + * string.c (rb_string_value_cstr): make NUL terminated if it is not done. Index: ruby_1_8/io.c =================================================================== --- ruby_1_8/io.c (revision 27338) +++ ruby_1_8/io.c (revision 27339) @@ -1594,6 +1594,7 @@ else { *strp = str = rb_str_buf_new(1); RSTRING(str)->ptr[RSTRING(str)->len++] = c; + RSTRING(str)->ptr[1] = '\0'; } } rb_thread_wait_fd(fileno(f)); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/