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
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
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
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
> 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
5 matches
Mail list logo