aboutsummaryrefslogtreecommitdiffstats
path: root/sprintf.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-15 07:23:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-15 07:23:38 +0000
commitbb545e213146685e0cdddb064ecc3b22139e01f9 (patch)
tree1bc8218dcb482b6034435b3f6034fa92e2ce1346 /sprintf.c
parente7878d20822cf00556c5ab02d0eb0cfe1a76cb93 (diff)
downloadruby-bb545e213146685e0cdddb064ecc3b22139e01f9.tar.gz
sprintf.c: coderange fix
* sprintf.c (ruby__sfvwrite): set buffer length and exclude uninitialized garbage to get correct coderange. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sprintf.c b/sprintf.c
index b41ab9cb39..3642e2153a 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -1174,6 +1174,7 @@ ruby__sfvwrite(register rb_printf_buffer *fp, register struct __suio *uio)
len -= n;
}
fp->_p = (unsigned char *)buf;
+ rb_str_set_len(result, buf - RSTRING_PTR(result));
return 0;
}