diff options
| author | Takashi Iwai <tiwai@suse.de> | 2025-07-10 12:06:09 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-07-11 09:53:14 +0200 |
| commit | 9a5cca8d838bc67da5c742ab1776d952364eccb5 (patch) | |
| tree | 5e9e2948d8563998160828a07f76efc1b3f455cf | |
| parent | 4e55e03e4c17150218c6869cee7cb754bd291522 (diff) | |
ALSA: cs423x: 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-28-tiwai@suse.de
| -rw-r--r-- | sound/isa/cs423x/cs4236.c | 2 | ||||
| -rw-r--r-- | sound/isa/cs423x/cs4236_lib.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c index ad20bb2649bd..e36cc147651a 100644 --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c @@ -510,7 +510,7 @@ static int snd_cs423x_pnpbios_detect(struct pnp_dev *pdev, return -ENODEV; /* prepare second id */ - strcpy(cid, pdev->id[0].id); + strscpy(cid, pdev->id[0].id); cid[5] = '1'; cdev = NULL; list_for_each_entry(iter, &(pdev->protocol->devices), protocol_list) { diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c index 1a03cff6915b..eaaf39aae526 100644 --- a/sound/isa/cs423x/cs4236_lib.c +++ b/sound/isa/cs423x/cs4236_lib.c @@ -1023,7 +1023,7 @@ int snd_cs4236_mixer(struct snd_wss *chip) if (snd_BUG_ON(!chip || !chip->card)) return -EINVAL; card = chip->card; - strcpy(card->mixername, snd_wss_chip_id(chip)); + strscpy(card->mixername, snd_wss_chip_id(chip)); if (chip->hardware == WSS_HW_CS4235 || chip->hardware == WSS_HW_CS4239) { |
