Re: [PATCHES] pstrndup()

2004-03-23 Thread Bruce Momjian
Karel Zak wrote: > On Mon, Mar 22, 2004 at 10:04:01AM -0500, Tom Lane wrote: > > Bruce Momjian <[EMAIL PROTECTED]> writes: > > > Karel Zak wrote: > > >> The result of strndup() is always zero terminated. It's more safe and > > >> strndup() is binary safe because it doesn't check something in i

Re: [PATCHES] pstrndup()

2004-03-22 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Karel Zak wrote: >> The result of strndup() is always zero terminated. It's more safe and >> strndup() is binary safe because it doesn't check something in input >> string. The pstrndup() is based on PostgreSQL memory managment. > Can you find place

Re: [PATCHES] pstrndup()

2004-03-22 Thread Bruce Momjian
Karel Zak wrote: > On Sun, Mar 21, 2004 at 11:45:18PM -0500, Tom Lane wrote: > > Bruce Momjian <[EMAIL PROTECTED]> writes: > > > Karel, do you plan to use pstrndup for some purpose? I assume so. > > I thinkPostgreSQL should supports basicoperation with > allocation/strings if

Re: [PATCHES] pstrndup()

2004-03-21 Thread Karel Zak
On Sun, Mar 21, 2004 at 11:45:18PM -0500, Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > Karel, do you plan to use pstrndup for some purpose? I assume so. I thinkPostgreSQL should supports basicoperation with allocation/strings if it's open for users' C func

Re: [PATCHES] pstrndup()

2004-03-21 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Karel, do you plan to use pstrndup for some purpose? I assume so. I am not familiar with strndup. If the spec is like strncpy, I would vote against including it ... strncpy is so broken that we had to invent our own variant ...

Re: [PATCHES] pstrndup()

2004-03-21 Thread Bruce Momjian
Karel, do you plan to use pstrndup for some purpose? I assume so. --- Karel Zak wrote: > > Hi guys, > > we have pstrdup(char *string) and this tiny patch adds > pstrndup(char *sting, Size len). > > By the way, I a

[PATCHES] pstrndup()

2004-03-17 Thread Karel Zak
Hi guys, we have pstrdup(char *string) and this tiny patch adds pstrndup(char *sting, Size len). By the way, I a little played with the apache memory managment and they have the others interesting routines like ap_pstrcat(...) that concatenate all arguments (last must be NU