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:
Piotr Caban 2019-03-16 14:48:08 +01:00 committed by Alexandre Julliard
parent cd6516eb94
commit 58140f73a2
1 changed files with 4 additions and 4 deletions

View File

@ -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;