From 461cef4d7d0270b5d11c2738c3a0a4e099351718 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 10 Jul 2025 12:06:05 +0200 Subject: [PATCH] ALSA: adlib: 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 Link: https://patch.msgid.link/20250710100727.22653-24-tiwai@suse.de --- sound/isa/adlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/isa/adlib.c b/sound/isa/adlib.c index f079ba4ef1a0..03fb2bce9255 100644 --- a/sound/isa/adlib.c +++ b/sound/isa/adlib.c @@ -61,8 +61,8 @@ static int snd_adlib_probe(struct device *dev, unsigned int n) return -EBUSY; } - strcpy(card->driver, DEV_NAME); - strcpy(card->shortname, CRD_NAME); + strscpy(card->driver, DEV_NAME); + strscpy(card->shortname, CRD_NAME); sprintf(card->longname, CRD_NAME " at %#lx", port[n]); error = snd_opl3_create(card, port[n], port[n] + 2, OPL3_HW_AUTO, 1, &opl3); -- 2.25.1