h3x4n1um / RETON

Reverse Engineering RTON File
GNU General Public License v3.0
33 stars 3 forks source link

Empty dictionaries are listed as "null" #13

Closed bontchev closed 3 years ago

bontchev commented 3 years ago

If the original JSON file that was compressed to RTON contained keys the value of which was an empty dictionary, rton2json outputs null instead of [].

Like, if the original was

{
    ...
    "objdata": {}
    ....
}

rton2json would convert it to

{
    ...
    "objdata": null
    ....
}

This is probably a bug.

h3x4n1um commented 3 years ago

Thankyou for your bug report

Interesting, ~I think this might be a bug of json library, let's me check on the library ASAP~

It's rton2json bug, I should have initiated

json_fifo::json res = json_fifo::json::object(),

Instead of

https://github.com/h3x4n1um/RETON/blob/8d295f30f65e06262a4d8e8d7f079dd294e488bf/rton-json/src/rton2json.cpp#L290

bontchev commented 3 years ago

Ah, any chance of making a release with the fix? I don't have a C++ compiler, so I can't compile it myself. I tried rewriting the thing in Python, but my C++ is sketchy and there are many things I don't understand.

h3x4n1um commented 3 years ago

Ah, any chance of making a release with the fix? I don't have a C++ compiler, so I can't compile it myself. I tried rewriting the thing in Python, but my C++ is sketchy and there are many things I don't understand.

I just release 3.1.1