]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: mpu401: Use safer strscpy() instead of strcpy()
authorTakashi Iwai <tiwai@suse.de>
Thu, 10 Jul 2025 10:05:46 +0000 (12:05 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 11 Jul 2025 07:51:08 +0000 (09:51 +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-5-tiwai@suse.de
sound/drivers/mpu401/mpu401.c

index cd01af5fa4edfcec42afe223b0591027879ec96a..d3f9424088d4f825216843293a6a69a0bf6654e8 100644 (file)
@@ -63,8 +63,8 @@ static int snd_mpu401_create(struct device *devptr, int dev,
                                0, &card);
        if (err < 0)
                return err;
-       strcpy(card->driver, "MPU-401 UART");
-       strcpy(card->shortname, card->driver);
+       strscpy(card->driver, "MPU-401 UART");
+       strscpy(card->shortname, card->driver);
        sprintf(card->longname, "%s at %#lx, ", card->shortname, port[dev]);
        if (irq[dev] >= 0) {
                sprintf(card->longname + strlen(card->longname), "irq %d", irq[dev]);