Commit 414e4f01 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: ua101: 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: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-99-tiwai@suse.de
parent f3d81c05
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1246,8 +1246,8 @@ static int ua101_probe(struct usb_interface *interface,
		goto probe_error;

	name = usb_id->idProduct == 0x0044 ? "UA-1000" : "UA-101";
	strcpy(card->driver, "UA-101");
	strcpy(card->shortname, name);
	strscpy(card->driver, "UA-101");
	strscpy(card->shortname, name);
	usb_make_path(ua->dev, usb_path, sizeof(usb_path));
	snprintf(ua->card->longname, sizeof(ua->card->longname),
		 "EDIROL %s (serial %s), %u Hz at %s, %s speed", name,
@@ -1272,7 +1272,7 @@ static int ua101_probe(struct usb_interface *interface,
	if (err < 0)
		goto probe_error;
	ua->pcm->private_data = ua;
	strcpy(ua->pcm->name, name);
	strscpy(ua->pcm->name, name);
	snd_pcm_set_ops(ua->pcm, SNDRV_PCM_STREAM_PLAYBACK, &playback_pcm_ops);
	snd_pcm_set_ops(ua->pcm, SNDRV_PCM_STREAM_CAPTURE, &capture_pcm_ops);
	snd_pcm_set_managed_buffer_all(ua->pcm, SNDRV_DMA_TYPE_VMALLOC,