Re: path.c char[strlen("xxx")] not portable

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Zeugswetter Andreas SB SD <ZeugswetterA(at)spardat(dot)at>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: path.c char[strlen("xxx")] not portable
Date: 2004-06-11 17:09:49
Message-ID: 200406111709.i5BH9nn03015@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


Patch applied. The only reason I used strlen is because sizeof a string
is one more than the strlen().

---------------------------------------------------------------------------

Zeugswetter Andreas SB SD wrote:
>
> strlen inside variable declaration is not portable C (AIX):
>
> char env_path[MAXPGPATH + strlen("PGLOCALEDIR=")];
>
> use sizeof instead.
>
> Please apply to current
>
> Andreas

Content-Description: path.c.locale.patch

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

--
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 Euler Taveira de Oliveira 2004-06-11 17:44:14 Re: translation updates pt_BR
Previous Message Bruce Momjian 2004-06-11 17:07:24 Re: Compiling libpq with VisualC