Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit afc3a57a authored by Dan Carpenter's avatar Dan Carpenter Committed by Jonathan Cameron
Browse files

iio:imu: adis16480: show_firmware() buffer too small



Smatch complains that snprintf() returns the number of characters,
not counting the NUL terminator, which *would* have been printed if
there were enough space.  In other words the return value could be more
than sizeof(buf).

In this case, we are printing something like "ff.ff\n" which is at most
6 characters and a NUL so that's not an issue.  I changed snprintf() to
scnprintf() to silence the warning.

But since the buffer doesn't include space for the NUL terminator, we
need to make it bigger or the "\n" will be truncated off.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-By: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 12660138
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment