[PATCH 3/7] libs/wine/string.c: strtoulW should set errno to ERANGE if an overflow will occur

Hugh McMaster hugh.mcmaster at outlook.com
Mon Feb 22 03:29:16 CST 2016


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 libs/wine/string.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libs/wine/string.c b/libs/wine/string.c
index f2a9bd3..b268bc7 100644
--- a/libs/wine/string.c
+++ b/libs/wine/string.c
@@ -19,6 +19,7 @@
  */
 
 #include <assert.h>
+#include <errno.h>
 #include <limits.h>
 #include <stdio.h>
 
@@ -274,6 +275,7 @@ unsigned long int strtoulW( const WCHAR *nptr, WCHAR **endptr, int base )
 
   if (overflow)
     {
+      errno = ERANGE;
       return ULONG_MAX;
     }
 
-- 
1.9.1




More information about the wine-patches mailing list