On Thu, Jul 15, 1999 at 06:28:52PM -0600, Warner Losh wrote:
>
> : Looking at OpenBSD's actual definition of strlcat() which returns the
> : number of chars that would have been in the final string is
> : potentially non-useful, but not really toooooo terrible.
> 
> No.  It is useful.  If you look at the return value, you can detect
> that an overflow would have happened and bail w/o having the overflow

No, they could simply return sizeof(buf) + 1 and have the same effect.
Running through the whole length of the string that would have been
created is potentially non-useful [sic].

It also potentially slows strlcat() down, particularly is some
programmers start to rely on its behaviour to find the new amount
of memory needed to allocate instead of doing the math themselves.


-- 
This is my .signature which gets appended to the end of my messages.


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to