summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--ext/stringio/stringio.c4
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 34891fd3b4..fbd10e01df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index b31f1818b2..de96121367 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -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;
}