mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
ALSA: aw2: 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-51-tiwai@suse.de
This commit is contained in:
parent
5cd156964f
commit
f6e41e48d9
1 changed files with 5 additions and 5 deletions
|
@ -281,8 +281,8 @@ static int snd_aw2_probe(struct pci_dev *pci,
|
|||
/* init spinlock */
|
||||
spin_lock_init(&chip->reg_lock);
|
||||
/* (4) Define driver ID and name string */
|
||||
strcpy(card->driver, "aw2");
|
||||
strcpy(card->shortname, "Audiowerk2");
|
||||
strscpy(card->driver, "aw2");
|
||||
strscpy(card->shortname, "Audiowerk2");
|
||||
|
||||
sprintf(card->longname, "%s with SAA7146 irq %i",
|
||||
card->shortname, chip->irq);
|
||||
|
@ -509,7 +509,7 @@ static int snd_aw2_new_pcm(struct aw2 *chip)
|
|||
pcm_device = &chip->device_playback[NUM_STREAM_PLAYBACK_ANA];
|
||||
|
||||
/* Set PCM device name */
|
||||
strcpy(pcm_playback_ana->name, "Analog playback");
|
||||
strscpy(pcm_playback_ana->name, "Analog playback");
|
||||
/* Associate private data to PCM device */
|
||||
pcm_playback_ana->private_data = pcm_device;
|
||||
/* set operators of PCM device */
|
||||
|
@ -541,7 +541,7 @@ static int snd_aw2_new_pcm(struct aw2 *chip)
|
|||
pcm_device = &chip->device_playback[NUM_STREAM_PLAYBACK_DIG];
|
||||
|
||||
/* Set PCM device name */
|
||||
strcpy(pcm_playback_num->name, "Digital playback");
|
||||
strscpy(pcm_playback_num->name, "Digital playback");
|
||||
/* Associate private data to PCM device */
|
||||
pcm_playback_num->private_data = pcm_device;
|
||||
/* set operators of PCM device */
|
||||
|
@ -574,7 +574,7 @@ static int snd_aw2_new_pcm(struct aw2 *chip)
|
|||
pcm_device = &chip->device_capture[NUM_STREAM_CAPTURE_ANA];
|
||||
|
||||
/* Set PCM device name */
|
||||
strcpy(pcm_capture->name, "Capture");
|
||||
strscpy(pcm_capture->name, "Capture");
|
||||
/* Associate private data to PCM device */
|
||||
pcm_capture->private_data = pcm_device;
|
||||
/* set operators of PCM device */
|
||||
|
|
Loading…
Add table
Reference in a new issue