diff --git a/src/timezone/strftime.c b/src/timezone/strftime.c index d9a18d49a8..3f6ba395c6 100644 --- a/src/timezone/strftime.c +++ b/src/timezone/strftime.c @@ -458,7 +458,8 @@ _fmt(const char *format, const struct pg_tm * t, char *pt, const char *ptlim, negative = diff < 0; if (diff == 0) { - negative = t->tm_zone[0] == '-'; + if (t->tm_zone != NULL) + negative = t->tm_zone[0] == '-'; } if (negative) {