mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* vsnprintf.c (cvt): set first byte of buf to NUL for the case when
no bytes are written to the buf. [ruby-dev:43062] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0858cbf3fd
commit
b680cd7d05
2 changed files with 6 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed Jan 19 02:54:04 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* vsnprintf.c (cvt): set first byte of buf to NUL for the case when
|
||||
no bytes are written to the buf. [ruby-dev:43062]
|
||||
|
||||
Tue Jan 18 23:04:51 2011 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* gc.h: parenthesize macro arguments.
|
||||
|
|
|
@ -1197,6 +1197,7 @@ cvt(value, ndigits, flags, sign, decpt, ch, length, buf)
|
|||
else {
|
||||
digits = BSD__dtoa(value, mode, ndigits, decpt, &dsgn, &rve);
|
||||
}
|
||||
buf[0] = 0; /* rve - digits may be 0 */
|
||||
memcpy(buf, digits, rve - digits);
|
||||
xfree(digits);
|
||||
rve = buf + (rve - digits);
|
||||
|
|
Loading…
Reference in a new issue