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

Configure Feed

Select the types of activity you want to include in your feed.

usb: gadget: u_audio: Use snprintf() instead of sprintf()

In order to be consistent with other s[n]printf() usage in this file,
switch to snprintf() here as well.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/5703e697687e4a39059bf90659969ffc86b2cfbd.1711176701.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Christophe JAILLET and committed by
Greg Kroah-Hartman
54ada484 39c34568

+2 -1
+2 -1
drivers/usb/gadget/function/u_audio.c
··· 1388 1388 1389 1389 strscpy(card->driver, card_name); 1390 1390 strscpy(card->shortname, card_name); 1391 - sprintf(card->longname, "%s %i", card_name, card->dev->id); 1391 + snprintf(card->longname, sizeof(card->longname), "%s %i", 1392 + card_name, card->dev->id); 1392 1393 1393 1394 snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS, 1394 1395 NULL, 0, BUFF_SIZE_MAX);