mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 03:24:19 +02:00
ALSA: cs4281: 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-56-tiwai@suse.de
This commit is contained in:
parent
e43c8878e9
commit
e3502b8672
|
|
@ -950,7 +950,7 @@ static int snd_cs4281_pcm(struct cs4281 *chip, int device)
|
|||
|
||||
pcm->private_data = chip;
|
||||
pcm->info_flags = 0;
|
||||
strcpy(pcm->name, "CS4281");
|
||||
strscpy(pcm->name, "CS4281");
|
||||
chip->pcm = pcm;
|
||||
|
||||
snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, &chip->pci->dev,
|
||||
|
|
@ -1715,7 +1715,7 @@ static int snd_cs4281_midi(struct cs4281 *chip, int device)
|
|||
err = snd_rawmidi_new(chip->card, "CS4281", device, 1, 1, &rmidi);
|
||||
if (err < 0)
|
||||
return err;
|
||||
strcpy(rmidi->name, "CS4281");
|
||||
strscpy(rmidi->name, "CS4281");
|
||||
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, &snd_cs4281_midi_output);
|
||||
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, &snd_cs4281_midi_input);
|
||||
rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT | SNDRV_RAWMIDI_INFO_INPUT | SNDRV_RAWMIDI_INFO_DUPLEX;
|
||||
|
|
@ -1870,8 +1870,8 @@ static int __snd_cs4281_probe(struct pci_dev *pci,
|
|||
if (err < 0)
|
||||
return err;
|
||||
snd_cs4281_create_gameport(chip);
|
||||
strcpy(card->driver, "CS4281");
|
||||
strcpy(card->shortname, "Cirrus Logic CS4281");
|
||||
strscpy(card->driver, "CS4281");
|
||||
strscpy(card->shortname, "Cirrus Logic CS4281");
|
||||
sprintf(card->longname, "%s at 0x%lx, irq %d",
|
||||
card->shortname,
|
||||
chip->ba0_addr,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user