mirror of https://gerrit.osmocom.org/asn1c
Fixed [1579558] (TZ longer than 64 chars on solaris, with FREEMEM redefined).
This commit is contained in:
parent
27fd0b6a46
commit
2fe66ca743
|
@ -105,10 +105,13 @@ static long GMTOFF(struct tm a){
|
||||||
tzold = getenv("TZ"); \
|
tzold = getenv("TZ"); \
|
||||||
if(tzold) { \
|
if(tzold) { \
|
||||||
size_t tzlen = strlen(tzold); \
|
size_t tzlen = strlen(tzold); \
|
||||||
if(tzlen < sizeof(tzoldbuf)) \
|
if(tzlen < sizeof(tzoldbuf)) { \
|
||||||
tzold = memcpy(tzoldbuf, tzold, tzlen + 1); \
|
tzold = memcpy(tzoldbuf, tzold, tzlen + 1); \
|
||||||
else \
|
} else { \
|
||||||
tzold = strdup(tzold); /* Ignore error */ \
|
char *dupptr = tzold;
|
||||||
|
tzold = MALLOC(tzlen + 1); \
|
||||||
|
if(tzold) memcpy(tzold, dupptr, tzlen + 1); \
|
||||||
|
} \
|
||||||
setenv("TZ", "UTC", 1); \
|
setenv("TZ", "UTC", 1); \
|
||||||
} \
|
} \
|
||||||
tzset(); \
|
tzset(); \
|
||||||
|
|
Loading…
Reference in New Issue