On Mon, Dec 21, 2015 at 03:47:56PM -0500, Tom Lane wrote:
> 1. Using strlcpy to copy from sources that are not known null-terminated
> is outright unsafe: someday, you'll fall off the end of memory and
> SIGSEGV.
>
> 2. Even with a known null-terminated string, using strlcpy to chop small
> pieces
There's been some effort to replace uses of strncpy() and our homegrown
StrNCpy() macro with strlcpy(). I had my nose rubbed today in the fact
that that isn't always a good transformation. The reason why not is that
strlcpy() is defined to return strlen(src), which means that even after
it's tran