Hugh McMaster : libwine: strtoulW and strtolW should set errno to ERANGE if an overflow will occur.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Feb 23 11:24:21 CST 2016
Module: wine
Branch: master
Commit: a9fb9ac657fccd45baee39df4dbe085a8a8e7014
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a9fb9ac657fccd45baee39df4dbe085a8a8e7014
Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date: Mon Feb 22 20:29:16 2016 +1100
libwine: strtoulW and strtolW should set errno to ERANGE if an overflow will occur.
Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
libs/wine/string.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libs/wine/string.c b/libs/wine/string.c
index f2a9bd3..7aa981f 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>
@@ -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;
}
More information about the wine-cvs
mailing list