Re: strcpy to strlcpy warnings

2005-10-27 Thread Matthias Kilian
On Thu, Oct 27, 2005 at 10:46:04AM -0700, John N. Brahy wrote: > strlcat(mailbox, MAILSPOOLHOME, sizeof(mailbox)); In addition to the other replies (pointer vs. array), the return value should be checked to avoid truncation. You don't want errors like this: $ cat > foo.c <<'EOD' #include #includ

Re: strcpy to strlcpy warnings

2005-10-27 Thread Hannah Schroeter
Hello! On Thu, Oct 27, 2005 at 10:46:04AM -0700, John N. Brahy wrote: >[...] >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? Works only if mailbox is dir

Re: strcpy to strlcpy warnings

2005-10-27 Thread jimmy
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

Re: strcpy to strlcpy warnings

2005-10-27 Thread Otto Moerbeek
On Thu, 27 Oct 2005, John N. Brahy wrote: > 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

Re: strcpy to strlcpy warnings

2005-10-27 Thread Theo de Raadt
> 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