From: Petri Lehtinen Date: Mon, 21 Mar 2011 06:22:32 +0000 (+0200) Subject: Fix json_object_size() return value X-Git-Tag: v2.0.1~6 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=jansson.git;a=commitdiff_plain;h=6ecba848171f48d0b3806dbc1aa306be8e69bc82 Fix json_object_size() return value Return 0 as documented if the argument is not a JSON object. Closes GH-18. --- diff --git a/src/value.c b/src/value.c index 123c7c0..937aa95 100644 --- a/src/value.c +++ b/src/value.c @@ -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;