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:
Wim Taymans 2021-02-02 12:09:29 +01:00
parent 41063578a5
commit 2b44f42845
13 changed files with 27 additions and 27 deletions

View file

@ -128,7 +128,7 @@ static void node_port_init(void *data, struct pw_impl_port *port)
if ((str = pw_properties_get(old, PW_KEY_AUDIO_CHANNEL)) == NULL ||
strcmp(str, "UNK") == 0) {
snprintf(position, sizeof(position)-1, "%d", pw_impl_port_get_id(port));
snprintf(position, sizeof(position), "%d", pw_impl_port_get_id(port));
str = position;
}
if (direction == n->direction) {