ALSA: control: Use safer strscpy() instead of strcpy()

Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-2-tiwai@suse.de
pull/476/head
Takashi Iwai 2025-07-10 12:05:43 +02:00
parent 3829d81b69
commit 8bb0a5fcde
1 changed files with 1 additions and 1 deletions

View File

@ -1435,7 +1435,7 @@ static int snd_ctl_elem_user_enum_info(struct snd_kcontrol *kcontrol,
names = ue->priv_data;
for (; item > 0; --item)
names += strlen(names) + 1;
strcpy(uinfo->value.enumerated.name, names);
strscpy(uinfo->value.enumerated.name, names);
return 0;
}