From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Ujfalusi Subject: Re: [PATCH] ARM:omap2: using strlcpy instead of strncpy Date: Mon, 4 Feb 2013 09:54:52 +0100 Message-ID: <510F775C.6010404@ti.com> References: <51090829.1010109@asianux.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from arroyo.ext.ti.com ([192.94.94.40]:49892 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753961Ab3BDIzG (ORCPT ); Mon, 4 Feb 2013 03:55:06 -0500 In-Reply-To: <51090829.1010109@asianux.com> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Chen Gang Cc: tony@atomide.com, Russell King - ARM Linux , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org On 01/30/2013 12:46 PM, Chen Gang wrote: >=20 > the fields must be null-terminated: > the caller may use it as null-terminted string, next. >=20 > Signed-off-by: Chen Gang Acked-by: Peter Ujfalusi > --- > arch/arm/mach-omap2/twl-common.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/t= wl-common.c > index e49b40b..6a7aec6 100644 > --- a/arch/arm/mach-omap2/twl-common.c > +++ b/arch/arm/mach-omap2/twl-common.c > @@ -23,6 +23,7 @@ > #include > #include > #include > +#include > #include > #include > =20 > @@ -56,7 +57,7 @@ void __init omap_pmic_init(int bus, u32 clkrate, > struct twl4030_platform_data *pmic_data) > { > omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_O= =46F_WAKEUPENABLE); > - strncpy(pmic_i2c_board_info.type, pmic_type, > + strlcpy(pmic_i2c_board_info.type, pmic_type, > sizeof(pmic_i2c_board_info.type)); > pmic_i2c_board_info.irq =3D pmic_irq; > pmic_i2c_board_info.platform_data =3D pmic_data; >=20 --=20 P=E9ter -- To unsubscribe from this list: send the line "unsubscribe linux-omap" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: peter.ujfalusi@ti.com (Peter Ujfalusi) Date: Mon, 4 Feb 2013 09:54:52 +0100 Subject: [PATCH] ARM:omap2: using strlcpy instead of strncpy In-Reply-To: <51090829.1010109@asianux.com> References: <51090829.1010109@asianux.com> Message-ID: <510F775C.6010404@ti.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 01/30/2013 12:46 PM, Chen Gang wrote: > > the fields must be null-terminated: > the caller may use it as null-terminted string, next. > > Signed-off-by: Chen Gang Acked-by: Peter Ujfalusi > --- > arch/arm/mach-omap2/twl-common.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c > index e49b40b..6a7aec6 100644 > --- a/arch/arm/mach-omap2/twl-common.c > +++ b/arch/arm/mach-omap2/twl-common.c > @@ -23,6 +23,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -56,7 +57,7 @@ void __init omap_pmic_init(int bus, u32 clkrate, > struct twl4030_platform_data *pmic_data) > { > omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); > - strncpy(pmic_i2c_board_info.type, pmic_type, > + strlcpy(pmic_i2c_board_info.type, pmic_type, > sizeof(pmic_i2c_board_info.type)); > pmic_i2c_board_info.irq = pmic_irq; > pmic_i2c_board_info.platform_data = pmic_data; > -- P?ter