summarylogtreecommitdiffstats
path: root/replace-strncpy.patch
blob: e8204fcd9d8d1a8bc8ded2c1af0cdf47bd3773ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- a/motu.c
+++ b/motu.c
@@ -912,7 +912,7 @@ static int motu_init_midi(struct motu *motu)
 	if (ret < 0)
 		return ret;
 
-	strncpy(rmidi->name, motu->card->shortname, sizeof(rmidi->name));
+	strscpy(rmidi->name, motu->card->shortname, sizeof(rmidi->name));
 
 	rmidi->info_flags = SNDRV_RAWMIDI_INFO_DUPLEX;
 	rmidi->private_data = motu;
@@ -1104,7 +1104,7 @@ static int motu_probe(struct usb_interface *interface,
 
 	snd_card_set_dev(card, &interface->dev);
 
-	strncpy(card->driver, "snd-motu", sizeof(card->driver));
+	strscpy(card->driver, "snd-motu", sizeof(card->driver));
 	snprintf(card->shortname, sizeof(card->shortname), "MOTU %s", str);
 	usb_make_path(motu->dev, usb_path, sizeof(usb_path));
 	snprintf(motu->card->longname, sizeof(motu->card->longname),