From: Roel Kluin Date: Fri, 17 Jul 2009 13:24:00 +0000 (+0200) Subject: i2c: strncpy does not null terminate string X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=783fd6fa4c144e3f6913e6fed89de10a6dd715a5;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git i2c: strncpy does not null terminate string strlcpy() will always null terminate the string. Signed-off-by: Roel Kluin Signed-off-by: Ben Dooks --- diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index fdd83277c8a..f2b82ee39ad 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -879,7 +879,7 @@ omap_i2c_probe(struct platform_device *pdev) i2c_set_adapdata(adap, dev); adap->owner = THIS_MODULE; adap->class = I2C_CLASS_HWMON; - strncpy(adap->name, "OMAP I2C adapter", sizeof(adap->name)); + strlcpy(adap->name, "OMAP I2C adapter", sizeof(adap->name)); adap->algo = &omap_i2c_algo; adap->dev.parent = &pdev->dev;