Commit e9dde5a9 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: caiaq: Fix -Wformat-truncation warning

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.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 78bd8f51
...@@ -485,7 +485,7 @@ static int init_card(struct snd_usb_caiaqdev *cdev) ...@@ -485,7 +485,7 @@ static int init_card(struct snd_usb_caiaqdev *cdev)
} }
usb_make_path(usb_dev, usbpath, sizeof(usbpath)); 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); cdev->vendor_name, cdev->product_name, usbpath);
setup_card(cdev); setup_card(cdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment