Passing something related to the length of the source as the
length argument to strlcpy triggers a warning, which is converted
to an error with --enable-checking (on FreeBSD 10.0). The current
code is safe, since it is using the same expression that was used
to allocate the destination buffer, but switch to using a separate
variable to hold the length and use that variable for both allocation
and copying, to appease the compiler.