]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: wm_adsp: Use scnprintf() for the limited buffer output
authorTakashi Iwai <tiwai@suse.de>
Fri, 13 Mar 2020 13:03:34 +0000 (14:03 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 13 Mar 2020 14:49:58 +0000 (14:49 +0000)
commit2e111ca816956b2c6a267d0b36db6e7bf7eed664
tree86883924145abb7c8f2c8ced40285c7341d3f889
parent4a098c98698d97a408dd09b5986ababe441b0c4f
ASoC: wm_adsp: Use scnprintf() for the limited buffer output

snprintf() is a hard-to-use function, it's especially difficult to use
it for concatenating substrings in a buffer with a limited size.
Since snprintf() returns the would-be-output size, not the actual
size, the subsequent use of snprintf() may point to the incorrect
position.

Use scnprintf() instead for fixing such potential errors.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200313130334.9028-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm_adsp.c