Commit 9830c385 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: seq: midi: Fix -Wformat-truncation warning

The compile warnings with -Wformat-truncation appearing at
snd_seq_midisynth_probe() in seq_midi.c are false-positive; those must
fit within 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-3-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 0d422608
...@@ -349,9 +349,9 @@ snd_seq_midisynth_probe(struct device *_dev) ...@@ -349,9 +349,9 @@ snd_seq_midisynth_probe(struct device *_dev)
if (! port->name[0]) { if (! port->name[0]) {
if (info->name[0]) { if (info->name[0]) {
if (ports > 1) if (ports > 1)
snprintf(port->name, sizeof(port->name), "%s-%u", info->name, p); scnprintf(port->name, sizeof(port->name), "%s-%u", info->name, p);
else else
snprintf(port->name, sizeof(port->name), "%s", info->name); scnprintf(port->name, sizeof(port->name), "%s", info->name);
} else { } else {
/* last resort */ /* last resort */
if (ports > 1) if (ports > 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment