]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: pcmtest: Replace deprecated strcpy() with strscpy()
authorThorsten Blum <thorsten.blum@linux.dev>
Tue, 1 Jul 2025 12:05:25 +0000 (14:05 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 2 Jul 2025 14:27:49 +0000 (16:27 +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/20250701120525.185831-2-thorsten.blum@linux.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/drivers/pcmtest.c

index 39f1e1fe4c446a0c1a594cd645dda3387b096f9a..19b3f306c5645660831a4be7c4856931f9f8bbbd 100644 (file)
@@ -36,6 +36,7 @@
 #include <sound/core.h>
 #include <linux/dma-mapping.h>
 #include <linux/platform_device.h>
+#include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/random.h>
 #include <linux/debugfs.h>
@@ -555,7 +556,7 @@ static int snd_pcmtst_new_pcm(struct pcmtst *pcmtst)
        if (err < 0)
                return err;
        pcm->private_data = pcmtst;
-       strcpy(pcm->name, "PCMTest");
+       strscpy(pcm->name, "PCMTest");
        pcmtst->pcm = pcm;
        snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_pcmtst_playback_ops);
        snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_pcmtst_capture_ops);
@@ -613,9 +614,9 @@ static int pcmtst_probe(struct platform_device *pdev)
        if (err < 0)
                return err;
 
-       strcpy(card->driver, "PCM-TEST Driver");
-       strcpy(card->shortname, "PCM-Test");
-       strcpy(card->longname, "PCM-Test virtual driver");
+       strscpy(card->driver, "PCM-TEST Driver");
+       strscpy(card->shortname, "PCM-Test");
+       strscpy(card->longname, "PCM-Test virtual driver");
 
        err = snd_card_register(card);
        if (err < 0)