Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: using "(void)" casts to purposefully ignore return values

On Thu, Aug 25, 2011 at 04:14:02PM +0930, Brett Lymn wrote:
 > > If you pass an unterminated string to ~any other string function,
 > > demons fly out of your nose. I'm not sure why you think there's
 > > anything noteworthy about strlcpy's behavior in this case.
 > I really really wish people would read the man page properly before
 > pontificating.  If you pass a string that is longer than the size you
 > told strlcat then the dst will not be nul terminated, of course this is
 > a screw up, passing bad parameters to strlcat.  I just find it
 > annoying that people have blind faith that strlcat will always DTRT no
 > matter what.  This is not the case.

And again, if you pass the same strings to strcat, demons fly out of
your nose. None of the string functions are meant to accept invalid
input; I don't see why the man page even bothers to define what
happens in this case. Arguably, it shouldn't.

David A. Holland

Home | Main Index | Thread Index | Old Index