summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-02 14:53:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-02 14:53:36 +0000
commit49ace175df6ede06edfa4e4bcbb37b2060f0b032 (patch)
tree8e63277e52eb46c10c83ca2406afae139c26f3a5
parent1ebb10f7c72382532b6c151e8af13cf1a4da59d1 (diff)
downloadruby-49ace175df6ede06edfa4e4bcbb37b2060f0b032.tar.gz
ruby-49ace175df6ede06edfa4e4bcbb37b2060f0b032.tar.xz
ruby-49ace175df6ede06edfa4e4bcbb37b2060f0b032.zip
* ext/stringio/stringio.c (strio_truncate): should MEMZERO an extended
part. [ruby-dev:25618] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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 fa92d960d..f28673cff 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.
Tue Feb 1 22:48:48 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 7c1e4ba5f..23ba3dce4 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -950,10 +950,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;
}