On Tue, 09 Mar 2021 20:14:19 +0000, Mark Lumsden wrote:

> Here is a diff from Joachim Wiberg's version of mg.
>
> "The strlcpy() function is guaranteed to never copy more than 'len - 1'
> bytes, so there is no need to check if we copied more.  This is a bogus
> warning since the introduction of strlcpy()."

That looks wrong to me.  strlcpy() returns the number of bytes it
would have copied if there was space.  But if there was insufficient
space then the return value can be larger.  It is not safe to blindly
use the return value without checking it first.

 - todd

Reply via email to