Fix json_object_size() return value

Return 0 as documented if the argument is not a JSON object.

Closes GH-18.
This commit is contained in:
Petri Lehtinen 2011-03-21 08:22:32 +02:00
parent b90ed1accb
commit 6ecba84817

View File

@ -91,7 +91,7 @@ size_t json_object_size(const json_t *json)
json_object_t *object;
if(!json_is_object(json))
return -1;
return 0;
object = json_to_object(json);
return object->hashtable.size;