mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-12 01:20:14 +00:00
ALSA: spi: 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-94-tiwai@suse.de
This commit is contained in:
parent
fee48aed6b
commit
3fb167d7ce
@ -336,7 +336,7 @@ static int snd_at73c213_pcm_new(struct snd_at73c213 *chip, int device)
|
||||
|
||||
pcm->private_data = chip;
|
||||
pcm->info_flags = SNDRV_PCM_INFO_BLOCK_TRANSFER;
|
||||
strcpy(pcm->name, "at73c213");
|
||||
strscpy(pcm->name, "at73c213");
|
||||
chip->pcm = pcm;
|
||||
|
||||
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &at73c213_playback_ops);
|
||||
@ -713,7 +713,7 @@ static int snd_at73c213_mixer(struct snd_at73c213 *chip)
|
||||
|
||||
card = chip->card;
|
||||
|
||||
strcpy(card->mixername, chip->pcm->name);
|
||||
strscpy(card->mixername, chip->pcm->name);
|
||||
|
||||
for (idx = 0; idx < ARRAY_SIZE(snd_at73c213_controls); idx++) {
|
||||
errval = snd_ctl_add(card,
|
||||
@ -983,8 +983,8 @@ static int snd_at73c213_probe(struct spi_device *spi)
|
||||
if (retval)
|
||||
goto out_ssc;
|
||||
|
||||
strcpy(card->driver, "at73c213");
|
||||
strcpy(card->shortname, board->shortname);
|
||||
strscpy(card->driver, "at73c213");
|
||||
strscpy(card->shortname, board->shortname);
|
||||
sprintf(card->longname, "%s on irq %d", card->shortname, chip->irq);
|
||||
|
||||
retval = snd_card_register(card);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user