]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: firewire: digi00x: Use safer strscpy() instead of strcpy()
authorTakashi Iwai <tiwai@suse.de>
Thu, 10 Jul 2025 10:05:57 +0000 (12:05 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 11 Jul 2025 07:52:34 +0000 (09:52 +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>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://patch.msgid.link/20250710100727.22653-16-tiwai@suse.de
sound/firewire/digi00x/digi00x-hwdep.c
sound/firewire/digi00x/digi00x.c

index aadf7d72485684763ea888de4ef3774532246eef..b150607c0a0d13801b935a4610da5e808c4cac5f 100644 (file)
@@ -188,7 +188,7 @@ int snd_dg00x_create_hwdep_device(struct snd_dg00x *dg00x)
        if (err < 0)
                return err;
 
-       strcpy(hwdep->name, "Digi00x");
+       strscpy(hwdep->name, "Digi00x");
        hwdep->iface = SNDRV_HWDEP_IFACE_FW_DIGI00X;
        hwdep->ops = ops;
        hwdep->private_data = dg00x;
index 704ae2a5316bde0b16290ec97b3d453257f64eaa..cebc35dcf8cd1a4372764bb8941fa48a29c5824d 100644 (file)
@@ -30,9 +30,9 @@ static int name_card(struct snd_dg00x *dg00x)
 
        model = skip_spaces(name);
 
-       strcpy(dg00x->card->driver, "Digi00x");
-       strcpy(dg00x->card->shortname, model);
-       strcpy(dg00x->card->mixername, model);
+       strscpy(dg00x->card->driver, "Digi00x");
+       strscpy(dg00x->card->shortname, model);
+       strscpy(dg00x->card->mixername, model);
        snprintf(dg00x->card->longname, sizeof(dg00x->card->longname),
                 "Digidesign %s, GUID %08x%08x at %s, S%d", model,
                 fw_dev->config_rom[3], fw_dev->config_rom[4],