Commit a9fb9ac6 authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

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

parent 99f2cebe
...@@ -19,6 +19,7 @@ ...@@ -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 ) ...@@ -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 ) ...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment