libwine: strtoulW and strtolW should set errno to ERANGE if an overflow will occur.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2016-02-22 20:29:16 +11:00 committed by Alexandre Julliard
parent 99f2cebe86
commit a9fb9ac657
1 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,7 @@
*/
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
@ -162,6 +163,7 @@ long int strtolW( const WCHAR *nptr, WCHAR **endptr, int base )
if (overflow)
{
errno = ERANGE;
return negative ? LONG_MIN : LONG_MAX;
}
@ -274,6 +276,7 @@ unsigned long int strtoulW( const WCHAR *nptr, WCHAR **endptr, int base )
if (overflow)
{
errno = ERANGE;
return ULONG_MAX;
}