pulse-server: take length of the right string

We need to take the length of the desc, not name, to construct the
extended 'Monitor of <desc>" string.
This commit is contained in:
Wim Taymans 2021-03-25 17:02:10 +01:00
parent faeb42fa66
commit 78da72ce30

View file

@ -4182,7 +4182,7 @@ static int fill_source_info(struct client *client, struct message *m,
snprintf(monitor_name, size, "%s.monitor", name); snprintf(monitor_name, size, "%s.monitor", name);
} }
if ((desc = spa_dict_lookup(info->props, PW_KEY_NODE_DESCRIPTION)) != NULL) { if ((desc = spa_dict_lookup(info->props, PW_KEY_NODE_DESCRIPTION)) != NULL) {
size_t size = strlen(name) + 20; size_t size = strlen(desc) + 20;
monitor_desc = alloca(size); monitor_desc = alloca(size);
snprintf(monitor_desc, size, "Monitor of %s", desc); snprintf(monitor_desc, size, "Monitor of %s", desc);
} else { } else {