* [PATCH] ALSA: pcmtest: Replace deprecated strcpy() with strscpy()
@ 2025-07-01 12:05 Thorsten Blum
2025-07-02 14:28 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2025-07-01 12:05 UTC (permalink / raw)
To: Ivan Orlov, Jaroslav Kysela, Takashi Iwai
Cc: Thorsten Blum, linux-sound, linux-kernel
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>
---
sound/drivers/pcmtest.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/sound/drivers/pcmtest.c b/sound/drivers/pcmtest.c
index 39f1e1fe4c44..19b3f306c564 100644
--- a/sound/drivers/pcmtest.c
+++ b/sound/drivers/pcmtest.c
@@ -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)
--
2.50.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-02 14:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-01 12:05 [PATCH] ALSA: pcmtest: Replace deprecated strcpy() with strscpy() Thorsten Blum
2025-07-02 14:28 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.