mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
check print_value return
This commit is contained in:
parent
de93d76d0b
commit
4d1dcaa160
8
cJSON.c
8
cJSON.c
@ -1154,8 +1154,7 @@ static char *print_array(const cJSON *item, int depth, cjbool fmt, printbuffer *
|
|||||||
child = item->child;
|
child = item->child;
|
||||||
while (child && !fail)
|
while (child && !fail)
|
||||||
{
|
{
|
||||||
ptr = print_value(child, depth + 1, fmt, p);
|
if (!print_value(child, depth + 1, fmt, p))
|
||||||
if (!ptr)
|
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -1472,7 +1471,10 @@ static char *print_object(const cJSON *item, int depth, cjbool fmt, printbuffer
|
|||||||
p->offset+=len;
|
p->offset+=len;
|
||||||
|
|
||||||
/* print value */
|
/* print value */
|
||||||
print_value(child, depth, fmt, p);
|
if (!print_value(child, depth, fmt, p))
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
p->offset = update(p);
|
p->offset = update(p);
|
||||||
|
|
||||||
/* print comma if not last */
|
/* print comma if not last */
|
||||||
|
Loading…
Reference in New Issue
Block a user