* io.c (io_shift_cbuf): should terminate.
http://golf.shinh.org/p.rb?DECimal+number+to+BINary#Ruby git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
95c52c8e6c
commit
8e7a682be0
@ -1,3 +1,8 @@
|
||||
Wed Apr 14 17:56:06 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* io.c (io_shift_cbuf): should terminate.
|
||||
http://golf.shinh.org/p.rb?DECimal+number+to+BINary#Ruby
|
||||
|
||||
Wed Apr 14 16:29:02 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* gc.c (GET_STACK_BOUNDS): fixed macro argument names. a patch from
|
||||
|
5
io.c
5
io.c
@ -1698,11 +1698,8 @@ io_shift_cbuf(rb_io_t *fptr, int len, VALUE *strp)
|
||||
*strp = str = rb_str_new(fptr->cbuf+fptr->cbuf_off, len);
|
||||
}
|
||||
else {
|
||||
size_t slen;
|
||||
str = *strp;
|
||||
slen = RSTRING_LEN(str);
|
||||
rb_str_resize(str, RSTRING_LEN(str) + len);
|
||||
memcpy(RSTRING_PTR(str)+slen, fptr->cbuf+fptr->cbuf_off, len);
|
||||
rb_str_cat(str, fptr->cbuf+fptr->cbuf_off, len);
|
||||
}
|
||||
fptr->cbuf_off += len;
|
||||
fptr->cbuf_len -= len;
|
||||
|
Loading…
x
Reference in New Issue
Block a user