i2c-stu300: make sure adapter-name is terminated
authorWolfram Sang <w.sang@pengutronix.de>
Mon, 31 Jan 2011 14:09:23 +0000 (15:09 +0100)
committerBen Dooks <ben-linux@fluff.org>
Tue, 22 Feb 2011 23:53:44 +0000 (23:53 +0000)
Use strlcpy instead of strncpy.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Linus Walleij <linus.walleij@stericsson.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
drivers/i2c/busses/i2c-stu300.c

index 495be451d326c5b860648e94ccad189c9438c0b2..266135ddf7fa3eeb84cc4e40516688a149cb16d0 100644 (file)
@@ -942,7 +942,7 @@ stu300_probe(struct platform_device *pdev)
        adap->owner = THIS_MODULE;
        /* DDC class but actually often used for more generic I2C */
        adap->class = I2C_CLASS_DDC;
-       strncpy(adap->name, "ST Microelectronics DDC I2C adapter",
+       strlcpy(adap->name, "ST Microelectronics DDC I2C adapter",
                sizeof(adap->name));
        adap->nr = bus_nr;
        adap->algo = &stu300_algo;