Re: pstrndup()

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: pstrndup()
Date: 2004-03-23 15:37:16
Message-ID: 200403231537.i2NFbGU29152@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Karel Zak wrote:
> On Mon, Mar 22, 2004 at 10:04:01AM -0500, Tom Lane wrote:
> > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> 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 places to use this function our backend? Seems that should
> > > be part of the patch.
> >
> > A bit of googling showed that strndup does appear in the "Linux
> > standards base", but it is not to be found in the Single Unix Spec.
> > That makes it at most quasi-standard IMHO.
>
> man strndup
>
> CONFORMING TO
> SVID 3, BSD 4.3

Strange, I don't see it on FreeBSD or BSD/OS. I wonder if it was
removed in BSD 4.4.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2004-03-23 16:03:05 Re: dollar quoting and pg_dump
Previous Message Tom Lane 2004-03-23 15:28:16 Re: dollar quoting and pg_dump