mirror of https://github.com/getdnsapi/getdns.git
fix for converting empty lists and dicts
This commit is contained in:
parent
2485c11e32
commit
906a8d68c2
|
@ -410,7 +410,10 @@ static int _jsmn_get_dict(struct mem_funcs *mf, const char *js, jsmntok_t *t,
|
||||||
char key_spc[1024], *key = NULL;
|
char key_spc[1024], *key = NULL;
|
||||||
getdns_item child_item;
|
getdns_item child_item;
|
||||||
|
|
||||||
for (i = 0; i < t->size; i++) {
|
if (t->size <= 0)
|
||||||
|
*r = GETDNS_RETURN_GOOD;
|
||||||
|
|
||||||
|
else for (i = 0; i < t->size; i++) {
|
||||||
if (t[j].type != JSMN_STRING &&
|
if (t[j].type != JSMN_STRING &&
|
||||||
t[j].type != JSMN_PRIMITIVE) {
|
t[j].type != JSMN_PRIMITIVE) {
|
||||||
|
|
||||||
|
@ -484,7 +487,10 @@ static int _jsmn_get_list(struct mem_funcs *mf, const char *js, jsmntok_t *t,
|
||||||
size_t i, j = 1, index = 0;
|
size_t i, j = 1, index = 0;
|
||||||
getdns_item child_item;
|
getdns_item child_item;
|
||||||
|
|
||||||
for (i = 0; i < t->size; i++) {
|
if (t->size <= 0)
|
||||||
|
*r = GETDNS_RETURN_GOOD;
|
||||||
|
|
||||||
|
else for (i = 0; i < t->size; i++) {
|
||||||
j += _jsmn_get_item(mf, js, t + j, count - j, &child_item, r);
|
j += _jsmn_get_item(mf, js, t + j, count - j, &child_item, r);
|
||||||
if (*r) break;
|
if (*r) break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue