Commit 99b6fdf7 authored by jan.koester's avatar jan.koester
Browse files

mail: use gmtime_s on Windows

parent 61d8d2d5
Loading
Loading
Loading
Loading
+4 −0
Changes for src/mail.cpp: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -188,7 +188,11 @@ std::string domainOf(const std::string &address) {
std::string rfc5322Date() {
    std::time_t now = std::time(nullptr);
    std::tm tm{};
#ifdef _WIN32
    gmtime_s(&tm, &now);
#else
    gmtime_r(&now, &tm);
#endif
    static const char *days[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
    static const char *months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
                                   "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};