mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-03-12 18:30:41 +00:00
MacTimeToTime(): ignore offset adjusted mktime() result if it didn't work
This commit is contained in:
parent
d66b125513
commit
70507f89da
@ -217,7 +217,10 @@ time_t MacTimeToTime(uint32 t)
|
||||
if (out_tm) {
|
||||
out_tm->tm_year -= yearofs;
|
||||
out_tm->tm_mday -= dayofs;
|
||||
out = mktime(out_tm);
|
||||
time_t offset_adjusted = mktime(out_tm);
|
||||
if (offset_adjusted != -1) {
|
||||
out = offset_adjusted;
|
||||
}
|
||||
} else {
|
||||
D(bug("MacTimeToTime: error applying offsets\n"));
|
||||
}
|
||||
|
@ -477,7 +477,10 @@ time_t MacTimeToTime(uint32 t)
|
||||
if (out_tm) {
|
||||
out_tm->tm_year -= yearofs;
|
||||
out_tm->tm_mday -= dayofs;
|
||||
out = mktime(out_tm);
|
||||
time_t offset_adjusted = mktime(out_tm);
|
||||
if (offset_adjusted != -1) {
|
||||
out = offset_adjusted;
|
||||
}
|
||||
} else {
|
||||
D(bug("MacTimeToTime: error applying offsets\n"));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user