mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
Add support for NULL strings
This commit is contained in:
parent
323c644084
commit
b589b7062d
4 changed files with 16 additions and 7 deletions
|
|
@ -105,7 +105,7 @@ static struct spa_dict *pw_spa_dict_copy(struct spa_dict *dict)
|
|||
|
||||
for (i = 0; i < dict->n_items; i++) {
|
||||
items[i].key = strdup(dict->items[i].key);
|
||||
items[i].value = strdup(dict->items[i].value);
|
||||
items[i].value = dict->items[i].value ? strdup(dict->items[i].value) : NULL;
|
||||
}
|
||||
return copy;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,10 @@ static void print_properties(struct spa_dict *props, char mark)
|
|||
}
|
||||
|
||||
spa_dict_for_each(item, props) {
|
||||
printf("%c\t\t%s = \"%s\"\n", mark, item->key, item->value);
|
||||
if (item->value)
|
||||
printf("%c\t\t%s = \"%s\"\n", mark, item->key, item->value);
|
||||
else
|
||||
printf("%c\t\t%s = (null)\n", mark, item->key);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue