aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/cpp/cpp_string_field.cc
diff options
context:
space:
mode:
authorGravatar xiaofeng@google.com <xiaofeng@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2012-05-16 05:41:31 +0000
committerGravatar xiaofeng@google.com <xiaofeng@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2012-05-16 05:41:31 +0000
commit20724211247b27e903bd25cdbe4ee4aab81445a8 (patch)
tree49f7cb3736aedb5a507fbd995f9eef329e603533 /src/google/protobuf/compiler/cpp/cpp_string_field.cc
parenta269a2c48bf8d6c1b0ed88e66beff4577c764739 (diff)
Fix issue 378
Diffstat (limited to 'src/google/protobuf/compiler/cpp/cpp_string_field.cc')
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_string_field.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/google/protobuf/compiler/cpp/cpp_string_field.cc b/src/google/protobuf/compiler/cpp/cpp_string_field.cc
index 8d611b69..3cec2b6b 100644
--- a/src/google/protobuf/compiler/cpp/cpp_string_field.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_string_field.cc
@@ -398,7 +398,8 @@ GenerateMergeFromCodedStream(io::Printer* printer) const {
descriptor_->type() == FieldDescriptor::TYPE_STRING) {
printer->Print(variables_,
"::google::protobuf::internal::WireFormat::VerifyUTF8String(\n"
- " this->$name$(0).data(), this->$name$(0).length(),\n"
+ " this->$name$(this->$name$_size() - 1).data(),\n"
+ " this->$name$(this->$name$_size() - 1).length(),\n"
" ::google::protobuf::internal::WireFormat::PARSE);\n");
}
}