Skip to content

Commit 7272b8b

Browse files
committed
ALSA: xen: Fix -Wformat-truncation warning
The compile warning with -Wformat-truncation at xen_snd_front_cfg_card() is false-positive; the loop can be only for SNDRV_PCM_DEVICES which is at most 32. For suppressing the warning, replace snprintf() with scnprintf(). As stated in the above, truncation doesn't matter. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent bc44e10 commit 7272b8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/xen/xen_snd_front_cfg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ int xen_snd_front_cfg_card(struct xen_snd_front_info *front_info,
483483
*stream_cnt = 0;
484484
num_devices = 0;
485485
do {
486-
snprintf(node, sizeof(node), "%d", num_devices);
486+
scnprintf(node, sizeof(node), "%d", num_devices);
487487
if (!xenbus_exists(XBT_NIL, xb_dev->nodename, node))
488488
break;
489489

0 commit comments

Comments
 (0)