JSON library fix for empty-named objects. Also, stuff Erik did that I don't fully understand, but he made me amend his commit :'(
This commit is contained in:
parent
526feda148
commit
3e559fdffd
3 changed files with 30 additions and 91 deletions
10
lib/json.cpp
10
lib/json.cpp
|
@ -442,10 +442,12 @@ std::string JSON::Value::toPacked(){
|
|||
r += 0xE0;
|
||||
if (objVal.size() > 0){
|
||||
for (JSON::ObjIter it = objVal.begin(); it != objVal.end(); it++){
|
||||
r += it->first.size() / 256;
|
||||
r += it->first.size() % 256;
|
||||
r += it->first;
|
||||
r += it->second.toPacked();
|
||||
if (it->first.size() > 0){
|
||||
r += it->first.size() / 256;
|
||||
r += it->first.size() % 256;
|
||||
r += it->first;
|
||||
r += it->second.toPacked();
|
||||
}
|
||||
}
|
||||
}
|
||||
r += (char)0x0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue