fix constant value encoding in json
This commit is contained in:
@@ -927,13 +927,16 @@ result_t ConstantDataField::readSymbols(const SymbolString& input, size_t offset
|
||||
if (result != RESULT_OK) {
|
||||
return result;
|
||||
}
|
||||
if (m_verify) {
|
||||
string value = coutput.str();
|
||||
FileReader::trim(&value);
|
||||
if (m_verify) {
|
||||
if (value != m_value) {
|
||||
return RESULT_ERR_OUT_OF_RANGE;
|
||||
}
|
||||
}
|
||||
if (outputFormat & OF_JSON) {
|
||||
*output << value;
|
||||
}
|
||||
return RESULT_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -118,6 +118,8 @@ int main() {
|
||||
{"x,,str:10,==dummy", "", "10fe07000a48616c6c6f2044752120", "00", "rW"},
|
||||
{"x,,str:10,=dummy", "", "10fe07000a64756d6d792020202020", "00", ""},
|
||||
{"x,,str:10,==dummy", "", "10fe07000a64756d6d792020202020", "00", ""},
|
||||
{",,str:5,=dummy", "\n \"0\": {\"name\": \"\", \"value\": \"dummy\"}", "10fe07000a64756d6d792020202020", "00", "j"},
|
||||
{",,str:5,==\"dummy\"","\n \"0\": {\"name\": \"\", \"value\": \"dummy\"}", "10fe07000a64756d6d792020202020", "00", "j"},
|
||||
{"x,,nts:10", "Hallo, Du!", "10fe07000a48616c6c6f2c20447521", "00", ""},
|
||||
{"x,,nts:10", "Hallo, Du!", "10fe07000a48616c6c6f2c20447521", "00", ""},
|
||||
{"x,,nts:10", "Hallo, Du", "10fe07000a48616c6c6f2c20447500", "00", ""},
|
||||
|
||||
Reference in New Issue
Block a user