diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-28 02:25:18 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-28 02:25:18 +0000 |
commit | aeb3ba1e58c6bc07d05f626d9d12769b822cb4a8 (patch) | |
tree | 1610e0559b26d6708a23bda7884856e6f0f26c1f | |
parent | baac6078e39a917beab1fa203205c38b319608b5 (diff) |
merges r30595 from trunk into ruby_1_9_2.
--
* 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/branches/ruby_1_9_2@30688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | version.h | 2 | ||||
-rw-r--r-- | vsnprintf.c | 1 |
3 files changed, 7 insertions, 1 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 02:46:55 2011 Aaron Patterson <aaron@tenderlovemaking.com> * ext/psych/lib/psych/visitors/json_tree.rb (visit_String): JSON @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 165 +#define RUBY_PATCHLEVEL 166 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 diff --git a/vsnprintf.c b/vsnprintf.c index 697d5fce08..7a3cdb783f 100644 --- a/vsnprintf.c +++ b/vsnprintf.c @@ -1165,6 +1165,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); |