Commit 2fe66ca7 authored by Lev Walkin's avatar Lev Walkin

Fixed [1579558] (TZ longer than 64 chars on solaris, with FREEMEM redefined).

parent 27fd0b6a
......@@ -105,10 +105,13 @@ static long GMTOFF(struct tm a){
tzold = getenv("TZ"); \
if(tzold) { \
size_t tzlen = strlen(tzold); \
if(tzlen < sizeof(tzoldbuf)) \
if(tzlen < sizeof(tzoldbuf)) { \
tzold = memcpy(tzoldbuf, tzold, tzlen + 1); \
else \
tzold = strdup(tzold); /* Ignore error */ \
} else { \
char *dupptr = tzold;
tzold = MALLOC(tzlen + 1); \
if(tzold) memcpy(tzold, dupptr, tzlen + 1); \
} \
setenv("TZ", "UTC", 1); \
} \
tzset(); \
......
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