Updates:
        Status: WorkingAsIntended
        Owner: jas...@google.com

Comment #1 on issue 285 by jas...@google.com: Generated C++ operator= to CopyFrom() to MergeFrom() mishandles bytes fields as strings
http://code.google.com/p/protobuf/issues/detail?id=285

Are you sure that when you execute step 2, the field actually gets that string value assigned? Note that the setter accepts a const char*, so if your code does:
foo.set_fieldname("\0\0\0\0abc")
You end up setting the source to a zero-length string. You would instead need to do:

string value("\0\0\0\0abc", 7);
foo.set_fieldname(value);

When I set the field this way, the full field was properly copied. For MergeFrom, the code generator emits:
set_fieldname(from.fieldname());
Looking through the revision history it does not appear to have ever used c_str()

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to