diff --git a/Common/FileUtil.h b/Common/FileUtil.h index ee34c1eb1f..e11a3d40f8 100644 --- a/Common/FileUtil.h +++ b/Common/FileUtil.h @@ -29,21 +29,20 @@ // User directory indices for GetUserPath enum { - D_USER_IDX, + D_USER_IDX, D_SCREENSHOTS_IDX, - D_LOGS_IDX, + D_LOGS_IDX, D_CONFIG_IDX, - F_CONFIG_IDX, + F_CONFIG_IDX, F_MAINLOG_IDX, NUM_PATH_INDICES }; -// No thread safe #ifdef _WIN32 -inline struct tm* localtime_r (const time_t *clock, struct tm *result) { - if (!clock || !result) return NULL; - memcpy(result,localtime(clock),sizeof(*result)); - return result; +inline struct tm* localtime_r(const time_t *clock, struct tm *result) { + if (localtime_s(result, clock) == 0) + return result; + return NULL; } #endif