Subject: Re: [PATCH] powerpc: Add of_register_i2c_devices()

From: Segher Boessenkool <[email-masked]>
Date: Wed, 1 Aug 2007 10:18:08 +0200

>>>>> +		strncpy(info->driver_name, i2c_devices[i].i2c_driver,
>>>>> KOBJ_NAME_LEN);
>>>>> +		strncpy(info->type, i2c_devices[i].i2c_type, I2C_NAME_SIZE);
>>>>
>>>> Why not just strcpy(), btw?
>>>
>>> Because target strings are finite length, and sources are just 
>>> pointers to
>>> some constant strings, which one might make arbitrarily long.
>>
>> So it's no problem if the name or type string gets cut short?
>> Just checking :-)
>
> Then it just won't match.

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.

> Have I passed or failed?:-)

Dunno, what is this test, anyway?  :-)

Segher