]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: mips: Use safer strscpy() instead of strcpy()
authorTakashi Iwai <tiwai@suse.de>
Thu, 10 Jul 2025 10:06:21 +0000 (12:06 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 11 Jul 2025 07:53:16 +0000 (09:53 +0200)
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-40-tiwai@suse.de
sound/mips/hal2.c

index 991793e6bda9b28080c892d1c008fe1c43c54d94..f88e6a6733a568d1f7af321323813f3e766bf0af 100644 (file)
@@ -706,7 +706,7 @@ static int hal2_pcm_create(struct snd_hal2 *hal2)
                return err;
 
        pcm->private_data = hal2;
-       strcpy(pcm->name, "SGI HAL2");
+       strscpy(pcm->name, "SGI HAL2");
 
        /* set operators */
        snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
@@ -862,8 +862,8 @@ static int hal2_probe(struct platform_device *pdev)
                return err;
        }
 
-       strcpy(card->driver, "SGI HAL2 Audio");
-       strcpy(card->shortname, "SGI HAL2 Audio");
+       strscpy(card->driver, "SGI HAL2 Audio");
+       strscpy(card->shortname, "SGI HAL2 Audio");
        sprintf(card->longname, "%s irq %i",
                card->shortname,
                SGI_HPCDMA_IRQ);