From 3f98754c16a5e4d0b5495eeba0ee2d3e8a23e7cd Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Fri, 17 May 2013 00:18:58 +0400 Subject: [PATCH] Fix #299 --- src/Buffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 8e5bd737..224b7be4 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -42,7 +42,8 @@ CString CBufLine::GetLine(const CClient& Client, const MCString& msParams) const // TODO support message-tags properly struct tm stm; memset(&stm, 0, sizeof(stm)); - gmtime_r(&m_time.tv_sec, &stm); + const time_t secs = m_time.tv_sec; // OpenBSD has tv_sec as int, so explicitly convert it to time_t to make gmtime_r() happy + gmtime_r(&secs, &stm); char sTime[20] = {}; strftime(sTime, sizeof(sTime), "%Y-%m-%dT%H:%M:%S", &stm); return "@time=" + CString(sTime) + "." + s_msec + "Z " + sStr;