mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 15:03:52 +08:00
ALSA: 6fire: 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-96-tiwai@suse.de
This commit is contained in:
@@ -125,8 +125,8 @@ static int usb6fire_chip_probe(struct usb_interface *intf,
|
||||
dev_err(&intf->dev, "cannot create alsa card.\n");
|
||||
return ret;
|
||||
}
|
||||
strcpy(card->driver, "6FireUSB");
|
||||
strcpy(card->shortname, "TerraTec DMX6FireUSB");
|
||||
strscpy(card->driver, "6FireUSB");
|
||||
strscpy(card->shortname, "TerraTec DMX6FireUSB");
|
||||
sprintf(card->longname, "%s at %d:%d", card->shortname,
|
||||
device->bus->busnum, device->devnum);
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ int usb6fire_midi_init(struct sfire_chip *chip)
|
||||
return ret;
|
||||
}
|
||||
rt->instance->private_data = rt;
|
||||
strcpy(rt->instance->name, "DMX6FireUSB MIDI");
|
||||
strscpy(rt->instance->name, "DMX6FireUSB MIDI");
|
||||
rt->instance->info_flags = SNDRV_RAWMIDI_INFO_OUTPUT |
|
||||
SNDRV_RAWMIDI_INFO_INPUT |
|
||||
SNDRV_RAWMIDI_INFO_DUPLEX;
|
||||
|
||||
@@ -640,7 +640,7 @@ int usb6fire_pcm_init(struct sfire_chip *chip)
|
||||
}
|
||||
|
||||
pcm->private_data = rt;
|
||||
strcpy(pcm->name, "DMX 6Fire USB");
|
||||
strscpy(pcm->name, "DMX 6Fire USB");
|
||||
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &pcm_ops);
|
||||
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_ops);
|
||||
snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_VMALLOC, NULL, 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user