[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH 2/2] ucrtbase: Make the strtod implementation C99 compatible
From:       Piotr Caban <piotr.caban () gmail ! com>
Date:       2015-08-31 8:10:21
Message-ID: 55E40BED.4090005 () gmail ! com
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic