ALSA: cs5535audio: 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-59-tiwai@suse.de
This commit is contained in:
Takashi Iwai
2025-07-10 12:06:40 +02:00
parent 2d5239eab8
commit fe9502be46
2 changed files with 3 additions and 3 deletions

View File

@@ -315,9 +315,9 @@ static int __snd_cs5535audio_probe(struct pci_dev *pci,
if (err < 0)
return err;
strcpy(card->driver, DRIVER_NAME);
strscpy(card->driver, DRIVER_NAME);
strcpy(card->shortname, "CS5535 Audio");
strscpy(card->shortname, "CS5535 Audio");
sprintf(card->longname, "%s %s at 0x%lx, irq %i",
card->shortname, card->driver,
cs5535au->port, cs5535au->irq);

View File

@@ -423,7 +423,7 @@ int snd_cs5535audio_pcm(struct cs5535audio *cs5535au)
pcm->private_data = cs5535au;
pcm->info_flags = 0;
strcpy(pcm->name, "CS5535 Audio");
strscpy(pcm->name, "CS5535 Audio");
snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
&cs5535au->pci->dev,