mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
ALSA: parisc: 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-41-tiwai@suse.de
This commit is contained in:
parent
7169b6a676
commit
c9b4168294
@ -601,7 +601,7 @@ snd_harmony_pcm_init(struct snd_harmony *h)
|
|||||||
|
|
||||||
pcm->private_data = h;
|
pcm->private_data = h;
|
||||||
pcm->info_flags = 0;
|
pcm->info_flags = 0;
|
||||||
strcpy(pcm->name, "harmony");
|
strscpy(pcm->name, "harmony");
|
||||||
h->pcm = pcm;
|
h->pcm = pcm;
|
||||||
|
|
||||||
h->psubs = NULL;
|
h->psubs = NULL;
|
||||||
@ -823,7 +823,7 @@ snd_harmony_mixer_init(struct snd_harmony *h)
|
|||||||
if (snd_BUG_ON(!h))
|
if (snd_BUG_ON(!h))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
card = h->card;
|
card = h->card;
|
||||||
strcpy(card->mixername, "Harmony Gain control interface");
|
strscpy(card->mixername, "Harmony Gain control interface");
|
||||||
|
|
||||||
for (idx = 0; idx < HARMONY_CONTROLS; idx++) {
|
for (idx = 0; idx < HARMONY_CONTROLS; idx++) {
|
||||||
err = snd_ctl_add(card,
|
err = snd_ctl_add(card,
|
||||||
@ -937,8 +937,8 @@ snd_harmony_probe(struct parisc_device *padev)
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto free_and_ret;
|
goto free_and_ret;
|
||||||
|
|
||||||
strcpy(card->driver, "harmony");
|
strscpy(card->driver, "harmony");
|
||||||
strcpy(card->shortname, "Harmony");
|
strscpy(card->shortname, "Harmony");
|
||||||
sprintf(card->longname, "%s at 0x%lx, irq %i",
|
sprintf(card->longname, "%s at 0x%lx, irq %i",
|
||||||
card->shortname, h->hpa, h->irq);
|
card->shortname, h->hpa, h->irq);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user