]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: ak4531: Use safer strscpy() instead of strcpy()
authorTakashi Iwai <tiwai@suse.de>
Thu, 10 Jul 2025 10:06:25 +0000 (12:06 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 11 Jul 2025 07:53:17 +0000 (09:53 +0200)
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-44-tiwai@suse.de
sound/pci/ak4531_codec.c

index 6af88e7b86f81f08cc6001fe3201e97697eb1c44..e54812bfb2c6ee2b7c34986e075373041156b645 100644 (file)
@@ -389,7 +389,7 @@ int snd_ak4531_mixer(struct snd_card *card,
                snd_ak4531_free(ak4531);
                return err;
        }
-       strcpy(card->mixername, "Asahi Kasei AK4531");
+       strscpy(card->mixername, "Asahi Kasei AK4531");
        ak4531->write(ak4531, AK4531_RESET, 0x03);      /* no RST, PD */
        udelay(100);
        ak4531->write(ak4531, AK4531_CLOCK, 0x00);      /* CODEC ADC and CODEC DAC use {LR,B}CLK2 and run off LRCLK2 PLL */