2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00

ALSA: vx: 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-13-tiwai@suse.de
This commit is contained in:
Takashi Iwai 2025-07-10 12:05:54 +02:00
parent 73e86d3666
commit c4a38b94ba
3 changed files with 3 additions and 3 deletions

View File

@ -806,7 +806,7 @@ struct vx_core *snd_vx_create(struct snd_card *card,
chip->card = card;
card->private_data = chip;
strcpy(card->driver, hw->name);
strscpy(card->driver, hw->name);
sprintf(card->shortname, "Digigram %s", hw->name);
vx_proc_init(chip);

View File

@ -903,7 +903,7 @@ int snd_vx_mixer_new(struct vx_core *chip)
struct snd_card *card = chip->card;
char name[32];
strcpy(card->mixername, card->driver);
strscpy(card->mixername, card->driver);
/* output level controls */
for (i = 0; i < chip->hw->num_outs; i++) {

View File

@ -1226,7 +1226,7 @@ int snd_vx_pcm_new(struct vx_core *chip)
pcm->private_free = snd_vx_pcm_free;
pcm->info_flags = 0;
pcm->nonatomic = true;
strcpy(pcm->name, chip->card->shortname);
strscpy(pcm->name, chip->card->shortname);
chip->pcm[i] = pcm;
}