mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
json: set state on final bare string
When we run out of chars and are inside a bare string, set our state so that the next round will continue instead of looping forever.
This commit is contained in:
parent
49d11acde0
commit
799bc13c85
2 changed files with 17 additions and 5 deletions
|
|
@ -164,11 +164,13 @@ static inline int spa_json_next(struct spa_json * iter, const char **value)
|
|||
}
|
||||
|
||||
}
|
||||
return (iter->depth == 0 ?
|
||||
(iter->state == __BARE && iter->cur < iter->end ?
|
||||
iter->cur - *value :
|
||||
0) :
|
||||
-1);
|
||||
if (iter->depth != 0)
|
||||
return -1;
|
||||
if (iter->state == __BARE) {
|
||||
iter->state = __STRUCT;
|
||||
return iter->cur - *value;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int spa_json_enter_container(struct spa_json *iter, struct spa_json *sub, char type)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue