Skip to contentSkip to conversation

Input: mtouch - switch to use scnprintf() to suppress truncation warning

PATCH New Andy Shevchenko 1 participant 1 message Jan 13

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: mtouch - switch to use scnprintf() to suppress truncation warning

Switch the driver to use scnprintf() to avoid warnings about potential truncation of "phys" field which we can tolerate.

---
 drivers/input/touchscreen/mtouch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/mtouch.c +1 -1
index eefae96a2d40..0427ae08c39d 100644
@@ -137,7 +137,7 @@ static int mtouch_connect(struct serio *serio, struct serio_driver *drv)
 
 	mtouch->serio = serio;
 	mtouch->dev = input_dev;
-	snprintf(mtouch->phys, sizeof(mtouch->phys), "%s/input0", serio->phys);
+	scnprintf(mtouch->phys, sizeof(mtouch->phys), "%s/input0", serio->phys);
 
 	input_dev->name = "MicroTouch Serial TouchScreen";
 	input_dev->phys = mtouch->phys;
Signature · 1 line
2.50.1