diff --git a/env/mock_env.cc b/env/mock_env.cc index bc295e0e7..c195e6c23 100644 --- a/env/mock_env.cc +++ b/env/mock_env.cc @@ -378,7 +378,8 @@ class TestMemLogger : public Logger { struct timeval now_tv; gettimeofday(&now_tv, nullptr); const time_t seconds = now_tv.tv_sec; - struct tm t{0, 0, 0, 0, 0, 0, 0, 0, 0}; + struct tm t; + memset(&t, 0, sizeof(t)); auto ret __attribute__((__unused__)) = localtime_r(&seconds, &t); assert(ret); p += snprintf(p, limit - p,