mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
spa: small cleanups
Use snprint to ensure null terminated strings. Initialize res, it would be uninitialized when setting a NULL Latency param.
This commit is contained in:
parent
50096e2c76
commit
5a596edd53
2 changed files with 3 additions and 2 deletions
|
|
@ -776,7 +776,8 @@ int spa_alsa_init(struct state *state, const struct spa_dict *info)
|
||||||
|
|
||||||
while (spa_json_get_string(&it[1], v, sizeof(v)) > 0 &&
|
while (spa_json_get_string(&it[1], v, sizeof(v)) > 0 &&
|
||||||
i < SPA_N_ELEMENTS(state->bound_ctls)) {
|
i < SPA_N_ELEMENTS(state->bound_ctls)) {
|
||||||
strncpy(state->bound_ctls[i].name, v, sizeof(state->bound_ctls[i].name));
|
snprintf(state->bound_ctls[i].name,
|
||||||
|
sizeof(state->bound_ctls[i].name), "%s", v);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
state->num_bind_ctls = i;
|
state->num_bind_ctls = i;
|
||||||
|
|
|
||||||
|
|
@ -677,7 +677,7 @@ impl_node_port_set_param(void *object,
|
||||||
{
|
{
|
||||||
struct seq_state *this = object;
|
struct seq_state *this = object;
|
||||||
struct seq_port *port;
|
struct seq_port *port;
|
||||||
int res;
|
int res = 0;
|
||||||
|
|
||||||
spa_return_val_if_fail(this != NULL, -EINVAL);
|
spa_return_val_if_fail(this != NULL, -EINVAL);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue