mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 12:53:04 -04:00
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
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user