1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/stringio/stringio.c (strio_truncate): should MEMZERO an extended

part.  [ruby-dev:25618]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2005-02-02 14:53:36 +00:00
parent 9b6581dc47
commit 729249159e
2 changed files with 12 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Wed Feb 2 23:52:53 2005 sheepman <sheepman@tcn.zaq.ne.jp>
* ext/stringio/stringio.c (strio_truncate): should MEMZERO an extended
part. [ruby-dev:25618]
Wed Feb 2 21:56:01 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/rss.rb (RSS::Element#convert): added.
@ -5,11 +10,11 @@ Wed Feb 2 21:56:01 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/rss.rb: convert -> need_convert.
* lib/rss/1.0.rb: ditto.
* lib/rss/0.9.rb: ditto.
* lib/rss/2.0.rb: ditto.
* lib/rss/trackback.rb: ditto.
Wed Feb 2 03:30:58 2005 Minero Aoki <aamine@loveruby.net>

View file

@ -934,10 +934,14 @@ strio_truncate(self, len)
{
VALUE string = writable(StringIO(self))->string;
long l = NUM2LONG(len);
long plen = RSTRING(string)->len;
if (l < 0) {
error_inval("negative legnth");
}
rb_str_resize(string, l);
if (plen < l) {
MEMZERO(RSTRING(string)->ptr + plen, char, l - plen);
}
return len;
}