projects
/
jansson.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b90ed1a
)
Fix json_object_size() return value
author
Petri Lehtinen
<petri@digip.org>
Mon, 21 Mar 2011 06:22:32 +0000
(08:22 +0200)
committer
Petri Lehtinen
<petri@digip.org>
Mon, 21 Mar 2011 06:22:34 +0000
(08:22 +0200)
Return 0 as documented if the argument is not a JSON object.
Closes GH-18.
src/value.c
patch
|
blob
|
history
diff --git
a/src/value.c
b/src/value.c
index
123c7c0
..
937aa95
100644
(file)
--- 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;