OSDN Git Service

ALSA: hda: Use scnprintf() for string truncation
authorTakashi Iwai <tiwai@suse.de>
Fri, 13 Mar 2020 13:02:41 +0000 (14:02 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 13 Mar 2020 14:59:04 +0000 (15:59 +0100)
commit0a7efa14e61ae2132fd718887deb28479b33386b
treebbc0c46cce80b04d5f35daeb1b19bd77d3aedff9
parent296a37fd029dd8a911396e3c28e0bbd5a2720a5d
ALSA: hda: Use scnprintf() for string truncation

snd_hdac_codec_modalias() truncates the string to the given size and
returns its size, but it returned a wrong size from snprintf().
snprintf() returns the would-be-output size, not the actual size.
Use scnprintf() instead to return the correct size.

Link: https://lore.kernel.org/r/20200313130241.8970-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/hda/hdac_device.c