mirror of
https://github.com/torvalds/linux.git
synced 2025-11-02 09:40:27 +02:00
ALSA: wss: 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-39-tiwai@suse.de
This commit is contained in:
parent
2e2a2feb91
commit
fc52ff69c5
1 changed files with 3 additions and 3 deletions
|
|
@ -1865,7 +1865,7 @@ int snd_wss_pcm(struct snd_wss *chip, int device)
|
|||
pcm->info_flags |= SNDRV_PCM_INFO_HALF_DUPLEX;
|
||||
if (chip->hardware != WSS_HW_INTERWAVE)
|
||||
pcm->info_flags |= SNDRV_PCM_INFO_JOINT_DUPLEX;
|
||||
strcpy(pcm->name, snd_wss_chip_id(chip));
|
||||
strscpy(pcm->name, snd_wss_chip_id(chip));
|
||||
|
||||
snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, chip->card->dev,
|
||||
64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024);
|
||||
|
|
@ -1896,7 +1896,7 @@ int snd_wss_timer(struct snd_wss *chip, int device)
|
|||
err = snd_timer_new(chip->card, "CS4231", &tid, &timer);
|
||||
if (err < 0)
|
||||
return err;
|
||||
strcpy(timer->name, snd_wss_chip_id(chip));
|
||||
strscpy(timer->name, snd_wss_chip_id(chip));
|
||||
timer->private_data = chip;
|
||||
timer->private_free = snd_wss_timer_free;
|
||||
timer->hw = snd_wss_timer_table;
|
||||
|
|
@ -2176,7 +2176,7 @@ int snd_wss_mixer(struct snd_wss *chip)
|
|||
|
||||
card = chip->card;
|
||||
|
||||
strcpy(card->mixername, chip->pcm->name);
|
||||
strscpy(card->mixername, chip->pcm->name);
|
||||
|
||||
/* Use only the first 11 entries on AD1848 */
|
||||
if (chip->hardware & WSS_HW_AD1848_MASK)
|
||||
|
|
|
|||
Loading…
Reference in a new issue