svn commit: r367701 - head/lib/libutil

Warner Losh imp at bsdimp.com
Sun Nov 15 20:05:17 UTC 2020


Hey Scott,

On Sun, Nov 15, 2020 at 11:46 AM Scott Long <scottl at samsco.org> wrote:

> The man page for strlcpy() made reference to the return value being
> equivalent to what snprintf() does.  The man page for snprintf() states
> that negatve return values are possible, so I assumed the same was
> true for strlcpy().  However, now that I’ve looked at the implementation
> of strlcpy(), I see that you’re correct.  The man pages are definitely
> confusing, and this isn’t the only place where I think there’s
> inconsistency in the documentation, or at least poor wording choices.


Yea, it says both that it will never return a negative value (since size_t
is never negative) and that it returns the same things as snprintf (which
is true... except for that detail which it glosses over in return type
differences).

So this issue doesn't get lost, I've added a clarification to the examples
in  https://reviews.freebsd.org/D27228 . Please take a look and let me know
what you think. If more extensive edits are needed, there's full context so
you can at least flag those in the review as well. I've read these too many
times to see the other places you're talking about, so a fresh set of eyes
would be helpful.

Warner


More information about the svn-src-all mailing list