Fix windows build
authorCarl Hetherington <cth@carlh.net>
Sat, 10 Oct 2015 10:36:46 +0000 (11:36 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 10 Oct 2015 10:36:46 +0000 (11:36 +0100)
src/lib/log_entry.cc

index 9b399e4b67f38a67d0eecb12f7fbb4a0ae939f60..7c0f68787c2d39366452b0ef41963b98a66e0c7d 100644 (file)
@@ -45,7 +45,8 @@ LogEntry::get () const
                s << _time.tv_sec << ":" << _time.tv_usec;
        } else {
                char buffer[64];
-               struct tm* t = localtime (&_time.tv_sec);
+               time_t const sec = _time.tv_sec;
+               struct tm* t = localtime (&sec);
                strftime (buffer, 64, "%c", t);
                string a (buffer);
                s << a.substr (0, a.length() - 1) << N_(": ");