msvcrt: Fix long limits in _atol_l.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cd6516eb94
commit
58140f73a2
|
@ -1094,11 +1094,11 @@ MSVCRT_long CDECL MSVCRT__atol_l(const char *str, MSVCRT__locale_t locale)
|
|||
{
|
||||
__int64 ret = MSVCRT_strtoi64_l(str, NULL, 10, locale);
|
||||
|
||||
if(ret > LONG_MAX) {
|
||||
ret = LONG_MAX;
|
||||
if(ret > MSVCRT_LONG_MAX) {
|
||||
ret = MSVCRT_LONG_MAX;
|
||||
*MSVCRT__errno() = MSVCRT_ERANGE;
|
||||
} else if(ret < LONG_MIN) {
|
||||
ret = LONG_MIN;
|
||||
} else if(ret < MSVCRT_LONG_MIN) {
|
||||
ret = MSVCRT_LONG_MIN;
|
||||
*MSVCRT__errno() = MSVCRT_ERANGE;
|
||||
}
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue