ALSA: caiaq: Fix -Wformat-truncation warning
authorTakashi Iwai <tiwai@suse.de>
Fri, 15 Sep 2023 08:27:53 +0000 (10:27 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 15 Sep 2023 11:21:31 +0000 (13:21 +0200)
The filling of card->longname can be gracefully truncated, as it's
only informative.  Use scnprintf() and suppress the superfluous
compile warning with -Wformat-truncation.

Link: https://lore.kernel.org/r/20230915082802.28684-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/caiaq/device.c

index 49f63f8..b5cbf1f 100644 (file)
@@ -485,7 +485,7 @@ static int init_card(struct snd_usb_caiaqdev *cdev)
        }
 
        usb_make_path(usb_dev, usbpath, sizeof(usbpath));
-       snprintf(card->longname, sizeof(card->longname), "%s %s (%s)",
+       scnprintf(card->longname, sizeof(card->longname), "%s %s (%s)",
                       cdev->vendor_name, cdev->product_name, usbpath);
 
        setup_card(cdev);