msvcrt: Don't detect overflow in atol implementation.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46845
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:49:08 +01:00 committed by Alexandre Julliard
parent 58140f73a2
commit 8c1684a50a
2 changed files with 22 additions and 0 deletions

View File

@ -1109,7 +1109,11 @@ MSVCRT_long CDECL MSVCRT__atol_l(const char *str, MSVCRT__locale_t locale)
*/
MSVCRT_long CDECL MSVCRT_atol(const char *str)
{
#if _MSVCR_VER == 0
return MSVCRT_atoi(str);
#else
return MSVCRT__atol_l(str, NULL);
#endif
}
#if _MSVCR_VER>=120

View File

@ -3047,6 +3047,23 @@ static void test_atoi(void)
ok(r == 0, "atoi(4294967296) = %d\n", r);
}
static void test_atol(void)
{
int r;
r = atol("0");
ok(r == 0, "atol(0) = %d\n", r);
r = atol("-1");
ok(r == -1, "atol(-1) = %d\n", r);
r = atol("1");
ok(r == 1, "atol(1) = %d\n", r);
r = atol("4294967296");
ok(r == 0, "atol(4294967296) = %d\n", r);
}
static void test_atof(void)
{
double d;
@ -3831,6 +3848,7 @@ START_TEST(string)
test__stricmp();
test__wcstoi64();
test_atoi();
test_atol();
test_atof();
test_strncpy();
test_strxfrm();