aboutsummaryrefslogtreecommitdiff
path: root/src/value.c
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2011-03-21 08:22:32 +0200
committerPetri Lehtinen <petri@digip.org>2011-03-21 08:22:34 +0200
commit6ecba848171f48d0b3806dbc1aa306be8e69bc82 (patch)
tree555f5b888f7c294542269cbec392a3e7f1d6f66a /src/value.c
parentb90ed1accb3fcdf1111dbe33a2ce4519eb6e5d0c (diff)
downloadjansson-6ecba848171f48d0b3806dbc1aa306be8e69bc82.zip
jansson-6ecba848171f48d0b3806dbc1aa306be8e69bc82.tar.gz
jansson-6ecba848171f48d0b3806dbc1aa306be8e69bc82.tar.bz2
Fix json_object_size() return value
Return 0 as documented if the argument is not a JSON object. Closes GH-18.
Diffstat (limited to 'src/value.c')
-rw-r--r--src/value.c2
1 files changed, 1 insertions, 1 deletions
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;