Subject: Re: [PATCH] powerpc: fix i2c device string format

From: Segher Boessenkool <[email-masked]>
Date: Thu, 9 Aug 2007 21:45:46 +0200

>> strncpy() won't put a terminating zero on there, is everything
>> that uses the resulting string okay with that?  Also, if the
>> name gets cut short, it might match some _other_ expected name.
>
> On Wed, 1 Aug 2007, Scott Wood wrote:
>
>> You could use strlcpy() instead, which always leaves a zero 
>> terminator.
>
> The patch below does exactly this - uses strlcpy() to guarantee 
> strings in
> i2c device type and driver_name fields are 0-terminated.

You're not checking the return values of these calls.  This would
be a good function to put attribute warn_unused_result on :-)

Segher