mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Add const qualifier to tzn returned by timestamp2tm()
The tzn value might come from tm->tm_zone, which libc declares as const, so it's prudent that the upper layers know about this as well.
This commit is contained in:
@ -119,7 +119,7 @@ SetEpochTimestamp(void)
|
||||
* local time zone. If out of this range, leave as GMT. - tgl 97/05/27
|
||||
*/
|
||||
static int
|
||||
timestamp2tm(timestamp dt, int *tzp, struct tm * tm, fsec_t *fsec, char **tzn)
|
||||
timestamp2tm(timestamp dt, int *tzp, struct tm * tm, fsec_t *fsec, const char **tzn)
|
||||
{
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
int64 dDate,
|
||||
@ -224,7 +224,7 @@ recalc_t:
|
||||
|
||||
*tzp = -tm->tm_gmtoff; /* tm_gmtoff is Sun/DEC-ism */
|
||||
if (tzn != NULL)
|
||||
*tzn = (char *) tm->tm_zone;
|
||||
*tzn = tm->tm_zone;
|
||||
#elif defined(HAVE_INT_TIMEZONE)
|
||||
*tzp = (tm->tm_isdst > 0) ? TIMEZONE_GLOBAL - SECS_PER_HOUR : TIMEZONE_GLOBAL;
|
||||
if (tzn != NULL)
|
||||
|
Reference in New Issue
Block a user