If someone is interested in fixing the json-c library, here is the original source code (note, that the upstream has even newer version of the json-c):