mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-17 23:47:40 +00:00
Fix a potential crash in localtime_r win32.
Using localtime_s anyway. Both ways it was actually threadsafe.
This commit is contained in:
parent
fa7182ec34
commit
d644dacced
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user