mirror of https://github.com/torvalds/linux.git
ALSA: pcsp: 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-8-tiwai@suse.de
This commit is contained in:
parent
0676ccf26f
commit
6d352251e9
|
|
@ -122,8 +122,8 @@ static int snd_card_pcsp_probe(int devnum, struct device *dev)
|
|||
if (err < 0)
|
||||
return err;
|
||||
|
||||
strcpy(card->driver, "PC-Speaker");
|
||||
strcpy(card->shortname, "pcsp");
|
||||
strscpy(card->driver, "PC-Speaker");
|
||||
strscpy(card->shortname, "pcsp");
|
||||
sprintf(card->longname, "Internal PC-Speaker at port 0x%x",
|
||||
pcsp_chip.port);
|
||||
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ int snd_pcsp_new_pcm(struct snd_pcsp *chip)
|
|||
|
||||
chip->pcm->private_data = chip;
|
||||
chip->pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
|
||||
strcpy(chip->pcm->name, "pcsp");
|
||||
strscpy(chip->pcm->name, "pcsp");
|
||||
|
||||
snd_pcm_set_managed_buffer_all(chip->pcm,
|
||||
SNDRV_DMA_TYPE_CONTINUOUS,
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ int snd_pcsp_new_mixer(struct snd_pcsp *chip, int nopcm)
|
|||
if (err < 0)
|
||||
return err;
|
||||
|
||||
strcpy(card->mixername, "PC-Speaker");
|
||||
strscpy(card->mixername, "PC-Speaker");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue