> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us] 
> Sent: Thursday, August 29, 2002 9:07 PM
> To: Alvaro Herrera
> Cc: Gordon Runkle; pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] [7.3devl] Using PGPASSWORDFILE with 
> psql requires -U 
> 
> 
> Alvaro Herrera <alvherre@atentus.com> writes:
> > ! 		ret=(char *)malloc(sizeof(char)*strlen(t));
> > ! 		strncpy(ret, t, strlen(t));
> >
> > ! 		ret=(char *)malloc(sizeof(char)*(strlen(t)+1));
> > ! 		strncpy(ret, t, strlen(t)+1);
> 
> What have you got against strdup() ?

The strdup() function is non-standard, and need not exist in a C
implementation.

Thu, 29 Aug 2002 21:12:28 -0700
"Dann Corbit" <DCorbit@connx.com>
Re: [7.3devl] Using PGPASSWORDFILE with psql requires -U 
Dann Corbit dijo: 

> > Alvaro Herrera <alvherre@atentus.com> writes:
> > > ! 		ret=(char *)malloc(sizeof(char)*strlen(t));
> > > ! 		strncpy(ret, t, strlen(t));
> > >
> > > ! 		ret=(char *)malloc(sizeof(char)*(strlen(t)+1));
> > > ! 		strncpy(ret, t, strlen(t)+1);
> > 
> > What have you got against strdup() ?
> 
> The strdup() function is non-standard, and need not exist in a C
> implementation.

Actually I have nothing against strdup(), and I think I have seen it in
Pg source.  I just didn't think about it ;-)

Feel free to change it if you want...

-- 
Alvaro Herrera (<alvherre[a]atentus.com>)
One man's impedance mismatch is another man's layer of abstraction.
(Lincoln Yeoh)


Fri, 30 Aug 2002 00:17:09 -0400 (CLT)
Alvaro Herrera <alvherre@atentus.com>
Re: [7.3devl] Using PGPASSWORDFILE with psql requires -U
"Dann Corbit" <DCorbit@connx.com> writes:
>> What have you got against strdup() ?

> The strdup() function is non-standard, and need not exist in a C
> implementation.

But it *does* exist in all Postgres implementations.  This is what
we carry around a port/ directory for ...

			regards, tom lane

Fri, 30 Aug 2002 00:25:29 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [7.3devl] Using PGPASSWORDFILE with psql requires -U 