topology: various coverity fixes

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2019-05-24 20:52:00 +02:00
parent 6efa23f283
commit 0d97f53c25
3 changed files with 18 additions and 10 deletions

View file

@ -880,8 +880,8 @@ int tplg_add_enum(snd_tplg_t *tplg, struct snd_tplg_enum_template *enum_ctl,
if (enum_ctl->texts != NULL) {
for (i = 0; i < num_items; i++) {
if (enum_ctl->texts[i] != NULL)
strncpy(ec->texts[i], enum_ctl->texts[i],
SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
snd_strlcpy(ec->texts[i], enum_ctl->texts[i],
SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
}
}