mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
pass the complete buffer size to snprintf
There is no reason to pass size-1, snprintf will always put a \0 at the end.
This commit is contained in:
parent
41063578a5
commit
2b44f42845
13 changed files with 27 additions and 27 deletions
|
|
@ -306,7 +306,7 @@ static void put_pod_value(struct data *d, const char *key, const struct spa_type
|
|||
uint32_t id = *(uint32_t*)body;
|
||||
str = spa_debug_type_find_short_name(info, *(uint32_t*)body);
|
||||
if (str == NULL) {
|
||||
snprintf(fallback, sizeof(fallback)-1, "id-%08x", id);
|
||||
snprintf(fallback, sizeof(fallback), "id-%08x", id);
|
||||
str = fallback;
|
||||
}
|
||||
put_value(d, NULL, str);
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ static struct node *add_node(struct data *d, uint32_t id, const char *name)
|
|||
if (name)
|
||||
strncpy(n->name, name, MAX_NAME-1);
|
||||
else
|
||||
snprintf(n->name, sizeof(n->name)-1, "%u", id);
|
||||
snprintf(n->name, sizeof(n->name), "%u", id);
|
||||
n->id = id;
|
||||
n->driver = n;
|
||||
spa_list_append(&d->node_list, &n->link);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue