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:
parent
99f2cebe86
commit
a9fb9ac657
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@ -162,6 +163,7 @@ long int strtolW( const WCHAR *nptr, WCHAR **endptr, int base )
|
||||||
|
|
||||||
if (overflow)
|
if (overflow)
|
||||||
{
|
{
|
||||||
|
errno = ERANGE;
|
||||||
return negative ? LONG_MIN : LONG_MAX;
|
return negative ? LONG_MIN : LONG_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,6 +276,7 @@ unsigned long int strtoulW( const WCHAR *nptr, WCHAR **endptr, int base )
|
||||||
|
|
||||||
if (overflow)
|
if (overflow)
|
||||||
{
|
{
|
||||||
|
errno = ERANGE;
|
||||||
return ULONG_MAX;
|
return ULONG_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue