diff options
author | Josh Haberman <jhaberman@gmail.com> | 2015-09-28 08:56:14 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2015-09-28 08:56:14 -0700 |
commit | 14e2b4fa51285d480ac36589e11c18d6d82819ca (patch) | |
tree | b20c65f86c152090eb9c3c63de750cb96ff57fdb /ruby/ext | |
parent | 0e5686a70768a289782eb1e1aa86646e56897e4d (diff) | |
download | protobuf-14e2b4fa51285d480ac36589e11c18d6d82819ca.tar.gz protobuf-14e2b4fa51285d480ac36589e11c18d6d82819ca.tar.bz2 protobuf-14e2b4fa51285d480ac36589e11c18d6d82819ca.zip |
A very small fix to silence some warnings.
Also updated the Gemfile.lock since alpha-4 has been
pushed to RubyGems.
Change-Id: I8ddc5f125f28aa9a33c88dfe48251a75a877e1d3
Diffstat (limited to 'ruby/ext')
-rw-r--r-- | ruby/ext/google/protobuf_c/encode_decode.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; } // ----------------------------------------------------------------------------- |