Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: firewire: digi00x: 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>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://patch.msgid.link/20250710100727.22653-16-tiwai@suse.de

+4 -4
+1 -1
sound/firewire/digi00x/digi00x-hwdep.c
··· 188 188 if (err < 0) 189 189 return err; 190 190 191 - strcpy(hwdep->name, "Digi00x"); 191 + strscpy(hwdep->name, "Digi00x"); 192 192 hwdep->iface = SNDRV_HWDEP_IFACE_FW_DIGI00X; 193 193 hwdep->ops = ops; 194 194 hwdep->private_data = dg00x;
+3 -3
sound/firewire/digi00x/digi00x.c
··· 30 30 31 31 model = skip_spaces(name); 32 32 33 - strcpy(dg00x->card->driver, "Digi00x"); 34 - strcpy(dg00x->card->shortname, model); 35 - strcpy(dg00x->card->mixername, model); 33 + strscpy(dg00x->card->driver, "Digi00x"); 34 + strscpy(dg00x->card->shortname, model); 35 + strscpy(dg00x->card->mixername, model); 36 36 snprintf(dg00x->card->longname, sizeof(dg00x->card->longname), 37 37 "Digidesign %s, GUID %08x%08x at %s, S%d", model, 38 38 fw_dev->config_rom[3], fw_dev->config_rom[4],