tests: Fix segv in t-json.c
* tests/json/t-json.c (test_contains): Avoid calling recusivly with no child.
This commit is contained in:
parent
55a1ae4163
commit
ac4bf86bb6
@ -260,7 +260,7 @@ test_contains (cjson_t needle, cjson_t hay)
|
|||||||
fprintf (stderr, "Depth mismatch. Expected child for %s\n",
|
fprintf (stderr, "Depth mismatch. Expected child for %s\n",
|
||||||
nonnull (needle->string));
|
nonnull (needle->string));
|
||||||
}
|
}
|
||||||
if (test_contains (needle->child, hay->child))
|
else if (test_contains (needle->child, hay->child))
|
||||||
{
|
{
|
||||||
int found = 0;
|
int found = 0;
|
||||||
cjson_t hit;
|
cjson_t hit;
|
||||||
|
Loading…
Reference in New Issue
Block a user