Fix json_object_size() return value
[jansson.git] / src / value.c
index 123c7c0..937aa95 100644 (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;