mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
json: add spa_json_parse_stringn()
It also checks the destination size.
This commit is contained in:
parent
c46113faa3
commit
611591d0fc
9 changed files with 30 additions and 20 deletions
|
|
@ -94,7 +94,8 @@ static int match(const char *rules, struct spa_dict *dict, uint64_t *quirks)
|
|||
if (spa_json_is_null(value, len)) {
|
||||
value = NULL;
|
||||
} else {
|
||||
spa_json_parse_string(value, SPA_MIN(len, (int)sizeof(val)-1), val);
|
||||
if (spa_json_parse_stringn(value, len, val, sizeof(val)) < 0)
|
||||
continue;
|
||||
value = val;
|
||||
}
|
||||
str = spa_dict_lookup(dict, key);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue