diff options
| author | Takashi Iwai <tiwai@suse.de> | 2025-07-10 13:06:40 +0300 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-07-11 10:53:19 +0300 |
| commit | fe9502be46f7b76b9d95fc5df7b018f48b8a22ce (patch) | |
| tree | 99e198ccabf8c78bb215e0c394bcbcc2121c8531 | |
| parent | 2d5239eab8ee2d474b5c1a70475f6fe87c74ba57 (diff) | |
| download | linux-fe9502be46f7b76b9d95fc5df7b018f48b8a22ce.tar.xz | |
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
| -rw-r--r-- | sound/pci/cs5535audio/cs5535audio.c | 4 | ||||
| -rw-r--r-- | sound/pci/cs5535audio/cs5535audio_pcm.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c index 0f319013a2a2..76566e7baea0 100644 --- a/sound/pci/cs5535audio/cs5535audio.c +++ b/sound/pci/cs5535audio/cs5535audio.c @@ -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); diff --git a/sound/pci/cs5535audio/cs5535audio_pcm.c b/sound/pci/cs5535audio/cs5535audio_pcm.c index 9c88e99e3750..f296b2c63026 100644 --- a/sound/pci/cs5535audio/cs5535audio_pcm.c +++ b/sound/pci/cs5535audio/cs5535audio_pcm.c @@ -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, |
