Dave Shield <d.t.shi...@liverpool.ac.uk> writes:

>> Probably the module/code you are discussing is only used on BSD
>> or there is an implementation of strlcpy somewhere in net-snmp for
>> systems without.
>
> The second is actually true.   (See snmplib/strlcpy.c)

Yep, and because we're using it in lots of places and we have a compat
function in place, I don't see a problem with using strlcpy in general.

In fact, I suspect if you go look at the usages of strncpy in the code
you may find that a large number of them end with foo[sizeof(foo)-1] = '\0'.
I know, because I think I wrote most of them :-P

> For consistency, it would seem sensible to use the same
> approach throughout  (always assuming that the null-terminated
> assumption of strlcpy holds).

Agreed...  and it looks like strlcpy might be the best choice.
-- 
Wes Hardaker
Please mail all replies to net-snmp-coders@lists.sourceforge.net

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to