mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-07 13:39:55 +00:00
fix(libc): keep the caller errno when the Windows tm_year range overflows
Co-Authored-By: Claude <[email protected]>
This commit is contained in:
1 parent
b1cf01464a
commit
a37ee5ff2c
1 file changed
+1
-1
@@ -479,7 +479,7 @@ GuestTm* APS5_VABI localtime_s_nid_postfix(const int64_t* timer, GuestTm* result
|
||||
}
|
||||
const std::int64_t year = host.tm_year + cycles * CALENDAR_CYCLE_YEARS;
|
||||
if (year < std::numeric_limits<int>::min() || year > std::numeric_limits<int>::max()) {
|
||||
errno = EINVAL;
|
||||
errno = callerError;
|
||||
return nullptr;
|
||||
}
|
||||
host.tm_year = static_cast<int>(year);
|
||||
|
||||
Reference in new issue
Block a user