diff --git a/src/timezone/strftime.c b/src/timezone/strftime.c index ab8f60e9c8..2f32cf8bdb 100644 --- a/src/timezone/strftime.c +++ b/src/timezone/strftime.c @@ -459,7 +459,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) {