diff mbox series

iio: chemical: atlas-ezo-sensor: switch character replacement to memmove

Message ID 20200722080904.30819-1-matt.ranostay@konsulko.com (mailing list archive)
State New, archived
Headers show
Series iio: chemical: atlas-ezo-sensor: switch character replacement to memmove | expand

Commit Message

Matt Ranostay July 22, 2020, 8:09 a.m. UTC
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
---
 drivers/iio/chemical/atlas-ezo-sensor.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/iio/chemical/atlas-ezo-sensor.c b/drivers/iio/chemical/atlas-ezo-sensor.c
index 7f8c641b8e93..60a0c752fbc5 100644
--- a/drivers/iio/chemical/atlas-ezo-sensor.c
+++ b/drivers/iio/chemical/atlas-ezo-sensor.c
@@ -83,8 +83,7 @@  static void atlas_ezo_sanitize(char *buf)
 	if (!ptr)
 		return;
 
-	for (; *ptr; ptr++)
-		*ptr = *(ptr + 1);
+	memmove(ptr, ptr + 1, strlen(ptr));
 }
 
 static int atlas_ezo_read_raw(struct iio_dev *indio_dev,