ucrtbase: Fix end pointer setting in parse_double on partial nan/infinity match.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6d70b1a66e
commit
3fc3d24c3c
|
@ -706,7 +706,11 @@ double parse_double(MSVCRT_wchar_t (*get)(void *ctx), void (*unget)(void *ctx),
|
|||
if(keep) {
|
||||
if (str_match == _infinity) return sign*INFINITY;
|
||||
if (str_match == _nan) return sign*NAN;
|
||||
} else if(found_sign) {
|
||||
unget(ctx);
|
||||
}
|
||||
|
||||
return make_double(sign, exp, d, ROUND_ZERO, err);
|
||||
}
|
||||
|
||||
if(nch == '0') {
|
||||
|
|
|
@ -144,6 +144,8 @@ static void test_strtod(void)
|
|||
test_strtod_str("inf42", INFINITY, 3);
|
||||
test_strtod_str("inffoo", INFINITY, 3);
|
||||
test_strtod_str("infini", INFINITY, 3);
|
||||
test_strtod_str("input", 0, 0);
|
||||
test_strtod_str("-input", 0, 0);
|
||||
|
||||
test_strtod_str("NAN", NAN, 3);
|
||||
test_strtod_str("nan", NAN, 3);
|
||||
|
|
Loading…
Reference in New Issue