Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: mpu401: 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-5-tiwai@suse.de

+2 -2
+2 -2
sound/drivers/mpu401/mpu401.c
··· 63 63 0, &card); 64 64 if (err < 0) 65 65 return err; 66 - strcpy(card->driver, "MPU-401 UART"); 67 - strcpy(card->shortname, card->driver); 66 + strscpy(card->driver, "MPU-401 UART"); 67 + strscpy(card->shortname, card->driver); 68 68 sprintf(card->longname, "%s at %#lx, ", card->shortname, port[dev]); 69 69 if (irq[dev] >= 0) { 70 70 sprintf(card->longname + strlen(card->longname), "irq %d", irq[dev]);