Skip site navigation (1) Skip section navigation (2)

Re: Meridiem markers (was: [BUGS] Incorrect "invalid AM/PM string" error from to_timestamp)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Brendan Jurd <direvus(at)gmail(dot)com>
Cc: Alex Hunsaker <badalex(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Meridiem markers (was: [BUGS] Incorrect "invalid AM/PM string" error from to_timestamp)
Date: 2009-01-27 04:05:13
Message-ID: 5549.1233029113@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Brendan Jurd <direvus(at)gmail(dot)com> writes:
> A quick grep through the backend code shows that strlcpy and strncpy
> are both in use, with neither having a clear majority.  I used strncpy
> because it is more prevalent within src/backend/utils/adt.

strncpy is generally deprecated; any remaining uses you find of it
are probably only there for lack of round tuits.  Use strlcpy in new
code, unless there's a pretty strong argument that strncpy is actually
clearer for a given usage.

(No, it's not a portability issue, because we have our own copy for
platforms without it; see src/port/.)

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2009-01-27 04:14:56
Subject: Re: Compiler warnings fix
Previous:From: Josh BerkusDate: 2009-01-27 04:03:41
Subject: Re: [COMMITTERS] pgsql: Automatic view update rules Bernd Helmle

Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group