On 3/4/2020 9:19 AM, Richard Cochran wrote:
> On Tue, Feb 18, 2020 at 01:25:00PM -0800, Jacob Keller wrote:
>>
>> I still think it would be good to have the functions guarantee the NULL
>> by manually assigning or using one of the string copy implementations
>> that will guarantee it. That way they don't have to rely on this assumption.
> 
> In the final version, we have,
> 
>       char name[MAX_IFNAME_SIZE + 1];                                         
>                                                                               
>  
>       char ts_label[MAX_IFNAME_SIZE + 1];                                     
>                                                                               
>  
>       strncpy(iface->name, name, MAX_IFNAME_SIZE);                            
>                                                                               
>  
>       memcpy(iface->ts_label, iface->name, MAX_IFNAME_SIZE);                  
>                                                                        
>       strncpy(iface->ts_label, label, MAX_IFNAME_SIZE);                       
>                                                                               
>  
> 
> so I think it is clear enough.  The use of MAX_IFNAME_SIZE is key.
> 
> Thanks,
> Richard
> 

Sure. It's not a big deal to me either way.


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to