summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/utils.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/utils.hpp b/src/common/utils.hpp
index 0de8d81..33117ac 100644
--- a/src/common/utils.hpp
+++ b/src/common/utils.hpp
@@ -74,7 +74,7 @@ struct TimeT : Comparable
TimeT(time_t t=0) : value(t) {}
TimeT(struct tm t) : value(timegm(&t)) {}
operator time_t() { return value; }
- operator struct tm() { return *gmtime(&value); }
+ operator struct tm() { time_t v = value; return *gmtime(&v); }
explicit operator bool() { return value; }
bool operator !() { return !value; }