Skip to content

Commit aadb033

Browse files
ujfalusitiwai
authored andcommitted
ALSA: usb-audio: scarlett_gen2: Fix another -Wformat-truncation warning
The recent enablement of -Wformat-truncation leads to a false-positive warning for mixer_scarlett_gen2.c. For suppressing the warning, replace snprintf() with scnprintf(). As stated in the above, truncation doesn't matter. Fixes: 78bd8f5 ("ALSA: usb-audio: scarlett_gen2: Fix -Wformat-truncation warning") Signed-off-by: Peter Ujfalusi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent b2ce002 commit aadb033

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/usb/mixer_scarlett_gen2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3205,8 +3205,8 @@ static int scarlett2_add_line_in_ctls(struct usb_mixer_interface *mixer)
32053205
/* Add input phantom controls */
32063206
if (info->inputs_per_phantom == 1) {
32073207
for (i = 0; i < info->phantom_count; i++) {
3208-
snprintf(s, sizeof(s), fmt, i + 1,
3209-
"Phantom Power", "Switch");
3208+
scnprintf(s, sizeof(s), fmt, i + 1,
3209+
"Phantom Power", "Switch");
32103210
err = scarlett2_add_new_ctl(
32113211
mixer, &scarlett2_phantom_ctl,
32123212
i, 1, s, &private->phantom_ctls[i]);

0 commit comments

Comments
 (0)