]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: mts64: Replace deprecated strcpy() with strscpy()
authorThorsten Blum <thorsten.blum@linux.dev>
Sun, 6 Jul 2025 16:09:03 +0000 (18:09 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 7 Jul 2025 07:57:09 +0000 (09:57 +0200)
strcpy() is deprecated; use strscpy() instead.

No functional changes intended.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250706160906.416270-1-thorsten.blum@linux.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/drivers/mts64.c

index 17f215bad0ec7741f4f255c767aaa0e29322daa8..bbeebbe467eaced5b822eda374a42c3816c4787d 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
+#include <linux/string.h>
 #include <sound/core.h>
 #include <sound/initval.h>
 #include <sound/rawmidi.h>
@@ -763,7 +764,7 @@ static int snd_mts64_rawmidi_create(struct snd_card *card)
                return err;
 
        rmidi->private_data = mts;
-       strcpy(rmidi->name, CARD_NAME);
+       strscpy(rmidi->name, CARD_NAME);
        rmidi->info_flags = SNDRV_RAWMIDI_INFO_OUTPUT |
                            SNDRV_RAWMIDI_INFO_INPUT |
                             SNDRV_RAWMIDI_INFO_DUPLEX;
@@ -791,7 +792,7 @@ static int snd_mts64_rawmidi_create(struct snd_card *card)
                mts->midi_input_substream[substream->number] = substream;
                switch(substream->number) {
                case MTS64_SMPTE_SUBSTREAM:
-                       strcpy(substream->name, "Miditerminal SMPTE");
+                       strscpy(substream->name, "Miditerminal SMPTE");
                        break;
                default:
                        sprintf(substream->name,
@@ -929,8 +930,8 @@ static int snd_mts64_probe(struct platform_device *pdev)
                dev_dbg(&pdev->dev, "Cannot create card\n");
                return err;
        }
-       strcpy(card->driver, DRIVER_NAME);
-       strcpy(card->shortname, "ESI " CARD_NAME);
+       strscpy(card->driver, DRIVER_NAME);
+       strscpy(card->shortname, "ESI " CARD_NAME);
        sprintf(card->longname,  "%s at 0x%lx, irq %i", 
                card->shortname, p->base, p->irq);