Commit 78bd8f51 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: usb-audio: scarlett_gen2: Fix -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.

Link: https://lore.kernel.org/r/20230915082802.28684-4-tiwai@suse.de


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 9830c385
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3218,7 +3218,7 @@ static int scarlett2_add_line_in_ctls(struct usb_mixer_interface *mixer)
			int from = i * info->inputs_per_phantom + 1;
			int to = (i + 1) * info->inputs_per_phantom;

			snprintf(s, sizeof(s), fmt2, from, to,
			scnprintf(s, sizeof(s), fmt2, from, to,
				  "Phantom Power", "Switch");
			err = scarlett2_add_new_ctl(
				mixer, &scarlett2_phantom_ctl,