mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 04:56:13 +02:00
ALSA: asihpi: 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-48-tiwai@suse.de
This commit is contained in:
parent
1813fa7c58
commit
1882c12ae2
|
|
@ -1257,7 +1257,7 @@ static int snd_card_asihpi_pcm_new(struct snd_card_asihpi *asihpi, int device)
|
|||
|
||||
pcm->private_data = asihpi;
|
||||
pcm->info_flags = 0;
|
||||
strcpy(pcm->name, "Asihpi PCM");
|
||||
strscpy(pcm->name, "Asihpi PCM");
|
||||
|
||||
/*? do we want to emulate MMAP for non-BBM cards?
|
||||
Jack doesn't work with ALSAs MMAP emulation - WHY NOT? */
|
||||
|
|
@ -2310,7 +2310,7 @@ static int snd_asihpi_clksrc_info(struct snd_kcontrol *kcontrol,
|
|||
uinfo->value.enumerated.item =
|
||||
uinfo->value.enumerated.items - 1;
|
||||
|
||||
strcpy(uinfo->value.enumerated.name,
|
||||
strscpy(uinfo->value.enumerated.name,
|
||||
clkcache->s[uinfo->value.enumerated.item].name);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -2530,7 +2530,7 @@ static int snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi)
|
|||
if (snd_BUG_ON(!asihpi))
|
||||
return -EINVAL;
|
||||
card = asihpi->card;
|
||||
strcpy(card->mixername, "Asihpi Mixer");
|
||||
strscpy(card->mixername, "Asihpi Mixer");
|
||||
|
||||
err =
|
||||
hpi_mixer_open(asihpi->hpi->adapter->index,
|
||||
|
|
@ -2741,7 +2741,7 @@ static int snd_asihpi_hpi_new(struct snd_card_asihpi *asihpi, int device)
|
|||
err = snd_hwdep_new(asihpi->card, "HPI", device, &hw);
|
||||
if (err < 0)
|
||||
return err;
|
||||
strcpy(hw->name, "asihpi (HPI)");
|
||||
strscpy(hw->name, "asihpi (HPI)");
|
||||
hw->iface = SNDRV_HWDEP_IFACE_LAST;
|
||||
hw->ops.open = snd_asihpi_hpi_open;
|
||||
hw->ops.ioctl = snd_asihpi_hpi_ioctl;
|
||||
|
|
@ -2889,7 +2889,7 @@ static int snd_asihpi_probe(struct pci_dev *pci_dev,
|
|||
by enable_hwdep module param*/
|
||||
snd_asihpi_hpi_new(asihpi, 0);
|
||||
|
||||
strcpy(card->driver, "ASIHPI");
|
||||
strscpy(card->driver, "ASIHPI");
|
||||
|
||||
sprintf(card->shortname, "AudioScience ASI%4X",
|
||||
asihpi->hpi->adapter->type);
|
||||
|
|
|
|||
|
|
@ -608,7 +608,7 @@ static void adapter_get_asserts(struct hpi_adapter_obj *pao,
|
|||
phr->u.ax.assert.p2 = 0;
|
||||
phr->u.ax.assert.count = 1; /* assert count */
|
||||
phr->u.ax.assert.dsp_index = -1; /* "dsp index" */
|
||||
strcpy(phr->u.ax.assert.sz_message, "PCI2040 error");
|
||||
strscpy(phr->u.ax.assert.sz_message, "PCI2040 error");
|
||||
phr->u.ax.assert.dsp_msg_addr = 0;
|
||||
gw_pci_read_asserts = 0;
|
||||
gw_pci_write_asserts = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user