Skip to contentSkip to conversation

ALSA: firewire: dice: Fix printf warning with W=1

PATCH New Takashi Iwai 1 participant 1 message Feb 27

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: firewire: dice: Fix printf warning with W=1

The use of snprintf() may cause a warning with W=1 due to the possibly truncated string. As the truncation doesn't really matter (and won't happen practically) in the case of dice driver, just shut it up by replacing with scnprintf().

---
 sound/firewire/dice/dice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/firewire/dice/dice.c +1 -1
index 85d265c7d544..f7a50bae4b55 100644
@@ -122,7 +122,7 @@ static void dice_card_strings(struct snd_dice *dice)
 	fw_csr_string(dev->config_rom + 5, CSR_VENDOR, vendor, sizeof(vendor));
 	strscpy(model, "?");
 	fw_csr_string(dice->unit->directory, CSR_MODEL, model, sizeof(model));
-	snprintf(card->longname, sizeof(card->longname),
+	scnprintf(card->longname, sizeof(card->longname),
 		 "%s %s (serial %u) at %s, S%d",
 		 vendor, model, dev->config_rom[4] & 0x3fffff,
 		 dev_name(&dice->unit->device), 100 << dev->max_speed);
Signature · 1 line
2.53.0