diff options
| author | Takashi Iwai <tiwai@suse.de> | 2025-07-10 12:06:58 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-07-11 09:53:22 +0200 |
| commit | c810473253842bf8df21bd0dee5195ef62d95a3c (patch) | |
| tree | 0f9da614f5a7153c40fd88119c40bc4408b73a01 | |
| parent | 1c8e3ebdfe3342b885cdf519d0bbc9e5a494c60a (diff) | |
| download | linux-c810473253842bf8df21bd0dee5195ef62d95a3c.tar.gz linux-c810473253842bf8df21bd0dee5195ef62d95a3c.zip | |
ALSA: pcxhr: 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-77-tiwai@suse.de
| -rw-r--r-- | sound/pci/pcxhr/pcxhr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index 242bd7e04b3e..bfd84c50e981 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c @@ -1149,7 +1149,7 @@ int pcxhr_create_pcm(struct snd_pcxhr *chip) pcm->info_flags = 0; pcm->nonatomic = true; - strcpy(pcm->name, name); + strscpy(pcm->name, name); snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, &chip->mgr->pci->dev, @@ -1605,7 +1605,7 @@ static int pcxhr_probe(struct pci_dev *pci, return err; } - strcpy(card->driver, DRIVER_NAME); + strscpy(card->driver, DRIVER_NAME); snprintf(card->shortname, sizeof(card->shortname), "Digigram [PCM #%d]", i); snprintf(card->longname, sizeof(card->longname), |
