[PATCH 2/2] ucrtbase: Make the strtod implementation C99 compatible

Piotr Caban piotr.caban at gmail.com
Mon Aug 31 03:10:21 CDT 2015


On 08/30/15 22:47, Martin Storsjo wrote:
> @@ -339,6 +341,38 @@ static double strtod_helper(const char *str, char **end, MSVCRT__locale_t locale
>       } else  if(*p == '+')
>           p++;
>
> +#if _MSVCR_VER >= 140
> +    if(p[0] == '0' && tolower(p[1]) == 'x') {
> +        char *e;
> +        MSVCRT_long val = sign*MSVCRT_strtol(p, &e, 16);
This will not work for doubles > LONG_MAX.

It will also not work if specified hexadecimal value has dot, e.g.:
strtod("0x1.1p+1") = 2.125

Thanks,
Piotr



More information about the wine-devel mailing list