> 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 your goal is to do the minimum and only the minimum, probably.

But you question is incomplete.  You don't provide enough facts.  It
is better if you go back and read and understand more.  We've been
clear enough in the manual page that there should be no questions.

Reply via email to