aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2015-12-23 07:40:02 +0200
committerPetri Lehtinen <petri@digip.org>2015-12-23 07:40:02 +0200
commit1c2e707b34da45c040db79540c7a7edde14195b6 (patch)
tree06a0ebcdf084b32aa6f7d043a1409176f2dca07b
parent52015cf35c516b5b83bf0ec0f4bfda3b53c19da2 (diff)
downloadjansson-1c2e707b34da45c040db79540c7a7edde14195b6.zip
jansson-1c2e707b34da45c040db79540c7a7edde14195b6.tar.gz
jansson-1c2e707b34da45c040db79540c7a7edde14195b6.tar.bz2
Fix a comment
-rw-r--r--src/pack_unpack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pack_unpack.c b/src/pack_unpack.c
index 617b3c0..9b1ef9e 100644
--- a/src/pack_unpack.c
+++ b/src/pack_unpack.c
@@ -446,6 +446,7 @@ static int unpack_object(scanner_t *s, json_t *root, va_list *ap)
if(!hashtable_get(&key_set, key)) {
unpacked++;
+ /* Save unrecognized keys for the error message */
if (!have_unrecognized_keys) {
strbuffer_init(&unrecognized_keys);
have_unrecognized_keys = 1;
@@ -461,7 +462,7 @@ static int unpack_object(scanner_t *s, json_t *root, va_list *ap)
}
if (unpacked) {
if (!gotopt) {
- /* Find the first unrecognized key */
+ /* Save unrecognized keys for the error message */
json_object_foreach(root, key, value) {
if(!hashtable_get(&key_set, key)) {
if (!have_unrecognized_keys) {