[PATCH] i2c: sun6-p2wi: fix call to snprintf

Boris BREZILLON boris.brezillon at free-electrons.com
Fri Jun 13 03:09:15 PDT 2014


On 13/06/2014 11:57, Russell King - ARM Linux wrote:
> On Fri, Jun 13, 2014 at 09:20:02AM +0200, Boris BREZILLON wrote:
>> -	snprintf(p2wi->adapter.name, sizeof(p2wi->adapter.name), pdev->name);
>> +	snprintf(p2wi->adapter.name, sizeof(p2wi->adapter.name), "%s",
>> +		 pdev->name);
> Isn't this just a complicated way to express:
>
> 	strlcpy(p2wi->adapter.name, pdev->name, sizeof(p2wi->adapter.name));
>
> ?

Yes it is. I'll make use of strlcpy instead.

Thanks,

Boris

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com




More information about the linux-arm-kernel mailing list