Re: Faster StrNCpy - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Faster StrNCpy
Date
Msg-id 200610022325.k92NPmF17480@momjian.us
Whole thread Raw
In response to Re: Faster StrNCpy  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Neil Conway <neilc@samurai.com> writes:
> > A wholesale replacement of strncpy() calls is probably worth doing --
> > replacing them with strlcpy() if the source string is NUL-terminated,
> > and I suppose memcpy() otherwise.
> 
> What I'd like to do immediately is put in strlcpy() and hit the two or
> three places I think are performance-relevant.  I agree with trying to
> get rid of StrNCpy/strncpy calls over the long run, but it's just code
> beautification and probably not appropriate for beta.

Added to TODO:
* Use strlcpy() rather than our StrNCpy() macro

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Sane error messages for SSL retry cases
Next
From: "Sergey E. Koposov"
Date:
Subject: Re: src/tools/msvc usage instructions