mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
acaa4a431e
commit
1ec5dcdd31
2 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Dec 18 01:46:48 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* sprintf.c (rb_str_format): need to clear output buffer to avoid
|
||||
broken encoding compatibility check.
|
||||
|
||||
Tue Dec 18 01:40:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/mkmf.rb (depend_rules): inserts ruby to only headers.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue