diff options
author | Jisi Liu <jisi.liu@gmail.com> | 2015-10-05 13:54:05 -0700 |
---|---|---|
committer | Jisi Liu <jisi.liu@gmail.com> | 2015-10-05 13:54:05 -0700 |
commit | 8d8177c75701014dfe27fec4cdd2b1647aefcb67 (patch) | |
tree | fdc5d0d0f2fd57f2ca641069c20b34ddf90ec919 /ruby | |
parent | 46e8ff63cb67a6520711da5317aaaef04d0414d0 (diff) | |
parent | cccf6fed7e2fad1240bb48ba0c47f3978ff7433d (diff) | |
download | protobuf-8d8177c75701014dfe27fec4cdd2b1647aefcb67.tar.gz protobuf-8d8177c75701014dfe27fec4cdd2b1647aefcb67.tar.bz2 protobuf-8d8177c75701014dfe27fec4cdd2b1647aefcb67.zip |
Merge remote-tracking branch 'origin/master' into fix-author
Diffstat (limited to 'ruby')
-rw-r--r-- | ruby/Gemfile.lock | 5 | ||||
-rw-r--r-- | ruby/ext/google/protobuf_c/encode_decode.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/ruby/Gemfile.lock b/ruby/Gemfile.lock index 91e1666f..8599da75 100644 --- a/ruby/Gemfile.lock +++ b/ruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - google-protobuf (3.0.0.alpha.4) + google-protobuf (3.0.0.alpha.4.0) GEM remote: https://rubygems.org/ @@ -23,3 +23,6 @@ DEPENDENCIES rake-compiler rubygems-tasks test-unit + +BUNDLED WITH + 1.10.6 diff --git a/ruby/ext/google/protobuf_c/encode_decode.c b/ruby/ext/google/protobuf_c/encode_decode.c index df4feac2..1c48281f 100644 --- a/ruby/ext/google/protobuf_c/encode_decode.c +++ b/ruby/ext/google/protobuf_c/encode_decode.c @@ -35,11 +35,13 @@ // For more information, see: // https://bugs.ruby-lang.org/issues/11328 VALUE noleak_rb_str_cat(VALUE rb_str, const char *str, long len) { + char *p; size_t oldlen = RSTRING_LEN(rb_str); rb_str_modify_expand(rb_str, len); - char *p = RSTRING_PTR(rb_str); + p = RSTRING_PTR(rb_str); memcpy(p + oldlen, str, len); rb_str_set_len(rb_str, oldlen + len); + return rb_str; } // ----------------------------------------------------------------------------- |