merces/pev — pull request #44 by jweyrich (2013-01-24 05:07:42+00:00)
Title: Portability fix: Ship our own copy of strlcat() from the OpenBSD implementation

Fix a portability issue regarding strlcat(). We now ship our own copy
of strlcat() from the OpenBSD implementation.
I renamed it to bsd_strlcat() with the intent of avoiding a couple of
preprocessor directives. To avoid other problems, always use our own
copy instead of the system's native.

A bit of history:
The strlcpy() and strlcat() functions first appeared in
OpenBSD 2.4, and made their appearance in FreeBSD 3.3.
They are not defined by ANSI/ISO C nor POSIX, and are not present in
GNU/Linux, but they're present in the Standard C Library (libc) of
all BSD-based systems, and some UNIX variants. Solaris ships it's
own version with slightly different semantics (see [1]) when `siz`
is 0, or when there are NIL characters in `dst`.

See [2] for a detailed explanation.

[1] http://goo.gl/oa6pJ
[2] http://goo.gl/4uKQg