projects
/
jansson.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ef13fb9
)
Fix an unpack example in the docs
author
Petri Lehtinen
<petri@digip.org>
Sun, 30 Jan 2011 10:53:52 +0000
(12:53 +0200)
committer
Petri Lehtinen
<petri@digip.org>
Sun, 30 Jan 2011 10:53:54 +0000
(12:53 +0200)
doc/apiref.rst
patch
|
blob
|
history
diff --git
a/doc/apiref.rst
b/doc/apiref.rst
index
fc839ab
..
adfd4d6
100644
(file)
--- a/
doc/apiref.rst
+++ b/
doc/apiref.rst
@@
-1014,9
+1014,9
@@
Examples::
/* returns 0 for validation success, nothing is extracted */
/* root is the JSON array [1, 2, 3, 4, 5] */
- int myint1, myint2
, ret
;
-
ret = json_unpack(root, "[ii*
]", &myint1, &myint2);
- assert(ret == 0 && myint1 == 1 && myint2 == 2);
+ int myint1, myint2;
+
json_unpack(root, "[ii!
]", &myint1, &myint2);
+ /* returns -1 for failed validation */
Equality