This is a trivial change to use snprintf rather than sprintf while building
the diagnostic output buffer.

Signed-off-by: Christopher Heiny <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Benjamin Tissoires <[email protected]>

---

 drivers/input/rmi4/rmi_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/rmi4/rmi_i2c.c b/drivers/input/rmi4/rmi_i2c.c
index b33074c..43b0e53 100644
--- a/drivers/input/rmi4/rmi_i2c.c
+++ b/drivers/input/rmi4/rmi_i2c.c
@@ -157,7 +157,7 @@ static int copy_to_debug_buf(struct device *dev, struct 
rmi_i2c_data *data,
        temp = data->debug_buf;
 
        for (i = 0; i < len; i++) {
-               n = sprintf(temp, " %02x", buf[i]);
+               n = snprintf(temp, 3, " %02x", buf[i]);
                temp += n;
        }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to