Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dump_string func return value check #649

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ static int do_dump(const json_t *json, size_t flags, int depth, hashtable_t *par
value = json_object_getn(json, key->key, key->len);
assert(value);

dump_string(key->key, key->len, dump, data, flags);
if (dump(separator, separator_length, data) ||
if (dump_string(key->key, key->len, dump, data, flags) ||
dump(separator, separator_length, data) ||
do_dump(value, flags, depth + 1, parents, dump, data)) {
jsonp_free(keys);
return -1;
Expand Down Expand Up @@ -394,8 +394,8 @@ static int do_dump(const json_t *json, size_t flags, int depth, hashtable_t *par
const char *key = json_object_iter_key(iter);
const size_t key_len = json_object_iter_key_len(iter);

dump_string(key, key_len, dump, data, flags);
if (dump(separator, separator_length, data) ||
if (dump_string(key, key_len, dump, data, flags) ||
dump(separator, separator_length, data) ||
do_dump(json_object_iter_value(iter), flags, depth + 1, parents,
dump, data))
return -1;
Expand Down