diff options
| author | Takashi Iwai <tiwai@suse.de> | 2025-07-10 13:06:54 +0300 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-07-11 10:53:21 +0300 |
| commit | c1b4f94c7645c58111cf53eb5165ab5fc65ec67d (patch) | |
| tree | 477878c0754361edff171da0469800be0c801b04 | |
| parent | ec4894f82775c9abe14afef9a29b913ee549ec06 (diff) | |
| download | linux-c1b4f94c7645c58111cf53eb5165ab5fc65ec67d.tar.xz | |
ALSA: maestro3: 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-73-tiwai@suse.de
| -rw-r--r-- | sound/pci/maestro3.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c index e61e15774706..e092097599ff 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c @@ -1846,7 +1846,7 @@ snd_m3_pcm(struct snd_m3 * chip, int device) pcm->private_data = chip; pcm->info_flags = 0; - strcpy(pcm->name, chip->card->driver); + strscpy(pcm->name, chip->card->driver); chip->pcm = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, @@ -2648,14 +2648,14 @@ __snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) switch (pci->device) { case PCI_DEVICE_ID_ESS_ALLEGRO: case PCI_DEVICE_ID_ESS_ALLEGRO_1: - strcpy(card->driver, "Allegro"); + strscpy(card->driver, "Allegro"); break; case PCI_DEVICE_ID_ESS_CANYON3D_2LE: case PCI_DEVICE_ID_ESS_CANYON3D_2: - strcpy(card->driver, "Canyon3D-2"); + strscpy(card->driver, "Canyon3D-2"); break; default: - strcpy(card->driver, "Maestro3"); + strscpy(card->driver, "Maestro3"); break; } |
