mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* io.c (appendline): should terminate.
http://golf.shinh.org/p.rb?DECimal+number+to+BINary#Ruby git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
09267569c3
commit
c89882197e
2 changed files with 5 additions and 1 deletions
|
|
@ -1,4 +1,7 @@
|
||||||
Wed Apr 14 15:58:11 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Wed Apr 14 17:53:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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
|
* string.c (rb_string_value_cstr): make NUL terminated if it is
|
||||||
not done.
|
not done.
|
||||||
|
|
|
||||||
1
io.c
1
io.c
|
|
@ -1594,6 +1594,7 @@ appendline(fptr, delim, strp)
|
||||||
else {
|
else {
|
||||||
*strp = str = rb_str_buf_new(1);
|
*strp = str = rb_str_buf_new(1);
|
||||||
RSTRING(str)->ptr[RSTRING(str)->len++] = c;
|
RSTRING(str)->ptr[RSTRING(str)->len++] = c;
|
||||||
|
RSTRING(str)->ptr[1] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rb_thread_wait_fd(fileno(f));
|
rb_thread_wait_fd(fileno(f));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue