diff options
author | Matti Vaittinen <mazziesaccount@gmail.com> | 2022-10-13 15:04:04 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-11-03 17:57:49 +0300 |
commit | 90ff5bef2bc7e55862df3c623175a9ee125e7715 (patch) | |
tree | 05f5e19b89abb45843d82dda7eee3e4dae3a60c2 /tools/build/Makefile.include | |
parent | 678d2cc2041cc6ce05030852dce9ad42719abcfc (diff) | |
download | linux-90ff5bef2bc7e55862df3c623175a9ee125e7715.tar.xz |
tools: iio: iio_utils: fix digit calculation
commit 72b2aa38191bcba28389b0e20bf6b4f15017ff2b upstream.
The iio_utils uses a digit calculation in order to know length of the
file name containing a buffer number. The digit calculation does not
work for number 0.
This leads to allocation of one character too small buffer for the
file-name when file name contains value '0'. (Eg. buffer0).
Fix digit calculation by returning one digit to be present for number
'0'.
Fixes: 096f9b862e60 ("tools:iio:iio_utils: implement digit calculation")
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/Y0f+tKCz+ZAIoroQ@dc75zzyyyyyyyyyyyyycy-3.rev.dnainternet.fi
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/build/Makefile.include')
0 files changed, 0 insertions, 0 deletions