Skip to content

Commit 2a47145

Browse files
committed
ALSA: sscape: Fix -Wformat-truncation warning
The warning with -Wformat-truncation at sscape_upload_microcode() is false-positive; the version number can be only a single digit, hence fitting with the given string size. 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-6-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent e9dde5a commit 2a47145

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/isa/sscape.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ static int sscape_upload_microcode(struct snd_card *card, int version)
557557
char name[14];
558558
int err;
559559

560-
snprintf(name, sizeof(name), "sndscape.co%d", version);
560+
scnprintf(name, sizeof(name), "sndscape.co%d", version);
561561

562562
err = request_firmware(&init_fw, name, card->dev);
563563
if (err < 0) {

0 commit comments

Comments
 (0)