json: check spa_json_get_string() return value correctly

It is only successful when > 0.
This commit is contained in:
Wim Taymans 2022-01-04 10:15:35 +01:00
parent 13c0cbb899
commit 68b31d37d9
2 changed files with 2 additions and 2 deletions

View file

@ -183,7 +183,7 @@ static void load_quirks(struct spa_bt_quirks *this, const char *str, size_t len)
if (spa_json_enter_object(&data, &rules) <= 0)
spa_json_init(&rules, str, len);
while (spa_json_get_string(&rules, key, sizeof(key)-1)) {
while (spa_json_get_string(&rules, key, sizeof(key)-1) > 0) {
int sz;
const char *value;