json: ignore '\0'

We ignore '\0' chars as we use the string length to check for the
end and the 0 chars might be inserted to parse the json in-place.
This commit is contained in:
Wim Taymans 2021-03-14 10:23:40 +01:00
parent eb4a439488
commit cc12755c6c

View file

@ -77,7 +77,7 @@ static inline int spa_json_next(struct spa_json * iter, const char **value)
goto again; goto again;
case __STRUCT: case __STRUCT:
switch (cur) { switch (cur) {
case '\t': case ' ': case '\r': case '\n': case ':': case '=': case ',': case '\0': case '\t': case ' ': case '\r': case '\n': case ':': case '=': case ',':
continue; continue;
case '#': case '#':
iter->state = __COMMENT; iter->state = __COMMENT;