Commit 3589f71e authored by Marc G. Fournier's avatar Marc G. Fournier

From: "D'Arcy J.M. Cain" <darcy@druid.net>

Subject: [HACKERS] backend/utils/adt/nabstime.c

There is a problem with some of the calls to strftime.  The second arg is
missing.  In all cases the buffer is CTZName which, according to the
file init/globals.c, is char CTZName[8] so I have added this value.
I know there should be a #define set up for this but I wasn't sure
which header to put it in.
parent 69c2c661
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.15 1997/03/18 16:35:20 scrappy Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.16 1997/03/21 18:53:28 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -62,13 +62,13 @@ GetCurrentAbsoluteTime(void) ...@@ -62,13 +62,13 @@ GetCurrentAbsoluteTime(void)
CTimeZone = - tmnow->tm_gmtoff; /* tm_gmtoff is Sun/DEC-ism */ CTimeZone = - tmnow->tm_gmtoff; /* tm_gmtoff is Sun/DEC-ism */
CDayLight = (tmnow->tm_isdst > 0); CDayLight = (tmnow->tm_isdst > 0);
/* XXX is there a better way to get local timezone string in V7? - tgl 97/03/18 */ /* XXX is there a better way to get local timezone string in V7? - tgl 97/03/18 */
strftime( CTZName, "%Z", localtime(&now)); strftime( CTZName, 8, "%Z", localtime(&now));
#endif #endif
#else /* ! USE_POSIX_TIME */ #else /* ! USE_POSIX_TIME */
CTimeZone = tbnow.timezone * 60; CTimeZone = tbnow.timezone * 60;
CDayLight = (tbnow.dstflag != 0); CDayLight = (tbnow.dstflag != 0);
/* XXX does this work to get the local timezone string in V7? - tgl 97/03/18 */ /* XXX does this work to get the local timezone string in V7? - tgl 97/03/18 */
strftime( CTZName, "%Z", localtime(&now)); strftime( CTZName, 8, "%Z", localtime(&now));
#endif #endif
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment