diff --git a/tz.cpp b/tz.cpp index e84f0fd..377968f 100644 --- a/tz.cpp +++ b/tz.cpp @@ -3134,7 +3134,8 @@ current_zone() { std::ostringstream os; char message[128]; - (void)strerror_r(errno, message, 128); + if (strerror_r(errno, message, sizeof(message)) != 0) + message[0] = '\0'; os << "realpath failure: errno = " << errno << "; " << message; throw std::runtime_error(os.str()); }