Bugfix: Don't use c_str for protobuf type bytes as an intermediate 0x00 is interpreted as terminator; fixes #170
This commit is contained in:
parent
f8d5cbd252
commit
147469beee
@ -450,7 +450,7 @@ void PythonFileFormat::writeFieldAssignment(
|
||||
std::string val = fieldDesc->is_repeated() ?
|
||||
refl->GetRepeatedStringReference(msg, fieldDesc, index, &val) :
|
||||
refl->GetStringReference(msg, fieldDesc, &val);
|
||||
QString escVal = escapeString(val.c_str());
|
||||
QString escVal = escapeString(QString::fromStdString(val));
|
||||
if (val != fieldDesc->default_value_string())
|
||||
out << fieldName << " = '" << escVal << "'\n";
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user