Quoting "John N. Brahy" <[EMAIL PROTECTED]>:

> First of all, it's been a while since I've written c, so I'm curious if
> this is a bulk change I can do.
>
>
>
> I'm changing code that another programmer did, but we got rid of him for
> doing stupid things. So I'm auditing his source code on a few of our
> customer's sites and I came across a strcat. And when I recompile it, I
> got warnings saying that it's almost always misused, then I read the
> manpage of strlcat and it seemed simple enough to do this:
>
>
>
> strcat(mailbox, MAILSPOOLHOME);
>
> strlcat(mailbox, MAILSPOOLHOME, sizeof(mailbox));
>
>
>
> Should I look out for anything special or is it safe to do this
> everywhere I see strcat or strcpy?
>
>

if 'mailbox' was malloc()'ed, that won't work as expected since sizeof is
or can be implemented as a macro.




----------------------------------------------------------------
This message has been sent through ihosting.be
To report spamming or other unaccepted behavior
by a iHosting customer, please send a message 
to [EMAIL PROTECTED]
----------------------------------------------------------------

Reply via email to