Fix compilation warning for Clang C++

This commit is contained in:
Vladimir Sadovnikov 2026-05-11 03:43:04 +03:00 committed by Wim Taymans
parent dae3e92adc
commit 5e9ecc3ce5

View file

@ -158,7 +158,9 @@ SPA_API_JSON_UTILS int spa_json_object_find(struct spa_json *iter, const char *k
{
struct spa_json obj = SPA_JSON_SAVE(iter);
int res, len = strlen(key) + 3;
char k[len];
char *k = (char *)alloca(len);
if (!k)
return -ENOMEM;
while ((res = spa_json_object_next(&obj, k, len, value)) > 0)
if (spa_streq(k, key))