diff --git a/api/boinc_api.cpp b/api/boinc_api.cpp index 63f14e9d94..9f875154e2 100644 --- a/api/boinc_api.cpp +++ b/api/boinc_api.cpp @@ -203,7 +203,11 @@ char* boinc_msg_prefix(char* sbuf, int len) { strcpy(sbuf, "time() failed"); return sbuf; } +#ifdef _WIN32 + if (localtime_s(&tm, &x) == EINVAL) { +#else if (localtime_r(&x, &tm) == NULL) { +#endif strcpy(sbuf, "localtime() failed"); return sbuf; }