When I use json-c 0.9 to parse cstr to json object, I found that if json_tokener_parse failed, the return address of json_object is the errcode
struct json_object* json_tokener_parse(const char *str){
struct json_tokener* tok;
struct json_object* obj;
tok = json_tokener_new();
obj = json_tokener_parse_ex(tok, str, -1);
if(tok->err != json_tokener_success)
obj = (struct json_object*)error_ptr(-tok->err);
json_tokener_free(tok);
return obj;
}
this is the code in json-c0.9 It's a bug? What should I check if it's failed?