iio: imu: inv_mpu6050: replace sprintf with scnprintf

Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
Jean-Baptiste Maneyrol 2017-06-07 13:42:26 +00:00 committed by Jonathan Cameron
parent 68cd6e5b20
commit 8a12ed7df7
1 changed files with 2 additions and 1 deletions

View File

@ -651,7 +651,8 @@ static ssize_t inv_attr_show(struct device *dev, struct device_attribute *attr,
case ATTR_ACCL_MATRIX:
m = st->plat_data.orientation;
return sprintf(buf, "%d, %d, %d; %d, %d, %d; %d, %d, %d\n",
return scnprintf(buf, PAGE_SIZE,
"%d, %d, %d; %d, %d, %d; %d, %d, %d\n",
m[0], m[1], m[2], m[3], m[4], m[5], m[6], m[7], m[8]);
default:
return -EINVAL;