json: fix parsing first array-array element

Previously, the first element inside the array-array didn't contain the
decoded data.

Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
This commit is contained in:
Michael Zimmermann 2021-06-16 23:26:19 +02:00 committed by Christopher Friedt
commit 5e7ef8be5a
3 changed files with 31 additions and 8 deletions

View file

@ -360,11 +360,14 @@ typedef int (*json_append_bytes_t)(const char *bytes, size_t len,
.offset = offsetof(struct_, \
len_field_), \
{ \
.object = { \
.sub_descr = \
.array = { \
.element_descr = \
elem_descr_, \
.sub_descr_len = \
elem_descr_len_, \
.n_elements = \
1 + \
ZERO_OR_COMPILE_ERROR( \
elem_descr_len_ == 1 \
), \
}, \
}, \
} }, \