diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-17 16:50:17 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-17 16:50:17 +0000 |
commit | 1ec5dcdd3120eb532ff9bf53d88f5316741f2b69 (patch) | |
tree | 33fe177c328c6ea14ccc472ec1ad45c8404b338c /sprintf.c | |
parent | acaa4a431ec4ac17c8db3295705f38d51de05f72 (diff) | |
download | bundler-1ec5dcdd3120eb532ff9bf53d88f5316741f2b69.tar.gz |
* sprintf.c (rb_str_format): need to clear output buffer to avoid
broken encoding compatibility check.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r-- | sprintf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -298,6 +298,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt) result = rb_str_buf_new(bsiz); rb_enc_copy(result, fmt); buf = RSTRING_PTR(result); + memset(buf, 0, bsiz); for (; p < end; p++) { const char *t; @@ -850,7 +851,6 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt) rb_str_resize(result, blen); if (tainted) OBJ_TAINT(result); - rb_enc_associate(result, enc); return result; } |