In article <20110410161417.ge4...@nef.pbox.org>,
Alistair Crooks  <a...@pkgsrc.org> wrote:
>hi christos,
>
>On Sat, Apr 09, 2011 at 04:53:39PM -0400, Christos Zoulas wrote:
>> - use struct copy instead of memcpy
>
>i haven't looked into this specific instance, but won't gcc (at least)
>produce the same code for memcpy as struct copy, and the memcpy call
>has the (admittedly arguable) distinction of being more readable.

It is more readable, exactly.

>> - snprintf("%s") -> strlcpy
>
>i use snprintf("%s") since it's more portable, and avoids having to
>indirect through autoconf HAVE_STRLCPY goo just to invoke
>snprintf("%s") in a stub re-implementation of strlcpy(3). feel the
>glibc luurrrrrrve.

This is a kernel device driver, and the kernel has strlcpy(3) and does
not use autoconf :-)

christos

Reply via email to