mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-25 18:31:14 +00:00
failsafe for localtime(-1) on Windows to avoid segfault
This commit is contained in:
parent
7c61312974
commit
07e9db881c
@ -133,6 +133,13 @@ uint32 TimeToMacTime(time_t t)
|
|||||||
// This code is taken from glibc 2.2
|
// This code is taken from glibc 2.2
|
||||||
|
|
||||||
// Convert to number of seconds elapsed since 1-Jan-1904
|
// Convert to number of seconds elapsed since 1-Jan-1904
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
if (t == -1) {
|
||||||
|
// failsafe as this will segfault
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
struct tm *local = localtime(&t);
|
struct tm *local = localtime(&t);
|
||||||
const int TM_EPOCH_YEAR = 1900;
|
const int TM_EPOCH_YEAR = 1900;
|
||||||
const int MAC_EPOCH_YEAR = 1904;
|
const int MAC_EPOCH_YEAR = 1904;
|
||||||
|
Loading…
Reference in New Issue
Block a user