diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2024-03-23 07:57:05 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-03-26 10:45:52 +0100 |
commit | 54ada48481a134b5953bc37cafd1ad89cd68c133 (patch) | |
tree | 2a707dbc77683eb9c14b7bf068746e7566f70356 /drivers/usb/gadget | |
parent | 39c34568d786ae97180faf79ecfd31c3d0671ba6 (diff) |
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>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/function/u_audio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/u_audio.c b/drivers/usb/gadget/function/u_audio.c index 5dba7ed9b0a1..1a634646bd24 100644 --- a/drivers/usb/gadget/function/u_audio.c +++ b/drivers/usb/gadget/function/u_audio.c @@ -1388,7 +1388,8 @@ int g_audio_setup(struct g_audio *g_audio, const char *pcm_name, strscpy(card->driver, card_name); strscpy(card->shortname, card_name); - sprintf(card->longname, "%s %i", card_name, card->dev->id); + snprintf(card->longname, sizeof(card->longname), "%s %i", + card_name, card->dev->id); snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS, NULL, 0, BUFF_SIZE_MAX); |