linux-stable/tools/iio
Matti Vaittinen 72b2aa3819 tools: iio: iio_utils: fix digit calculation
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: 096f9b862e ("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>
2022-10-17 08:51:26 +01:00
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Build tools: iio: Correctly add make dependency for iio_utils 2019-11-10 17:11:06 +00:00
Makefile kbuild: replace $(if A,A,B) with $(or A,B) 2022-02-15 12:25:56 +09:00
iio_event_monitor.c iio: event_monitor: add pitch, yaw and roll modifiers 2022-09-21 18:42:55 +01:00
iio_generic_buffer.c tools: iio: convert iio_generic_buffer to use new IIO buffer API 2021-03-11 20:47:07 +00:00
iio_utils.c tools: iio: iio_utils: fix digit calculation 2022-10-17 08:51:26 +01:00
iio_utils.h iio: event_monitor: Enable events before monitoring 2021-03-25 19:13:52 +00:00
lsiio.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00