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

Configure Feed

Select the types of activity you want to include in your feed.

ALSA: amd7930: replace strcpy() with strscpy()

strcpy() is deprecated; use strscpy() instead.

Both the destination and source buffer are of fixed length
so strscpy with 2-arguments is used.

No functional changes intended.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Siddarth Gundu <siddarthsgml@gmail.com>
Link: https://patch.msgid.link/20250520113012.70270-1-siddarthsgml@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Siddarth Gundu and committed by
Takashi Iwai
2bae25a8 0718a78f

+5 -4
+5 -4
sound/sparc/amd7930.c
··· 39 39 #include <linux/of.h> 40 40 #include <linux/platform_device.h> 41 41 #include <linux/io.h> 42 + #include <linux/string.h> 42 43 43 44 #include <sound/core.h> 44 45 #include <sound/pcm.h> ··· 755 754 756 755 pcm->private_data = amd; 757 756 pcm->info_flags = 0; 758 - strcpy(pcm->name, amd->card->shortname); 757 + strscpy(pcm->name, amd->card->shortname); 759 758 amd->pcm = pcm; 760 759 761 760 snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS, ··· 875 874 return -EINVAL; 876 875 877 876 card = amd->card; 878 - strcpy(card->mixername, card->shortname); 877 + strscpy(card->mixername, card->shortname); 879 878 880 879 for (idx = 0; idx < ARRAY_SIZE(amd7930_controls); idx++) { 881 880 if ((err = snd_ctl_add(card, ··· 1008 1007 if (err < 0) 1009 1008 return err; 1010 1009 1011 - strcpy(card->driver, "AMD7930"); 1012 - strcpy(card->shortname, "Sun AMD7930"); 1010 + strscpy(card->driver, "AMD7930"); 1011 + strscpy(card->shortname, "Sun AMD7930"); 1013 1012 sprintf(card->longname, "%s at 0x%02lx:0x%08Lx, irq %d", 1014 1013 card->shortname, 1015 1014 rp->flags & 0xffL,