Quick fix rtc crash, probably gives wrong results.

This commit is contained in:
Unknown W. Brackets 2013-01-25 08:34:04 -08:00
parent 1cd5421bdc
commit 6e6e71d116

View File

@ -140,7 +140,12 @@ void __RtcTicksToPspTime(ScePspDateTime &t, u64 ticks)
time_t time = (ticks - rtcMagicOffset) / 1000000ULL;
t.microsecond = ticks % 1000000ULL;
tm *local = gmtime(&time);
tm *local = gmtime(&time);
if (!local)
{
ERROR_LOG(HLE, "Date is too high/low to handle, pretending to work.");
return;
}
t.year = local->tm_year + 1900 - numYearAdd * 400;
t.month = local->tm_mon + 1;