fix constant value encoding in json

This commit is contained in:
John
2025-01-01 16:30:48 +01:00
parent edcb01955e
commit fab1dd1b1f
2 changed files with 6 additions and 1 deletions
+4 -1
View File
@@ -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;
}
+2
View File
@@ -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", ""},