[PATCH 2/4] msvcrt: Set errno in strtod.
Daniel Lehman
dlehman25 at gmail.com
Wed Jul 15 13:36:29 CDT 2020
Signed-off-by: Daniel Lehman <dlehman25 at gmail.com>
---
dlls/msvcrt/string.c | 3 ++-
dlls/msvcrt/tests/string.c | 1 -
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c
index 62ec54607e..cf4fc65ff4 100644
--- a/dlls/msvcrt/string.c
+++ b/dlls/msvcrt/string.c
@@ -696,6 +696,8 @@ double parse_double(MSVCRT_wchar_t (*get)(void *ctx), void (*unget)(void *ctx),
nch = get(ctx);
}
+ if(!err) err = MSVCRT__errno();
+ *err = 0;
if(!found_digit) {
if(nch != MSVCRT_WEOF) unget(ctx);
if(found_dp) unget(ctx);
@@ -759,7 +761,6 @@ double parse_double(MSVCRT_wchar_t (*get)(void *ctx), void (*unget)(void *ctx),
if(off < 0) off += LIMB_DIGITS;
if(off) bnum_mult(&b, p10s[off]);
- if(!err) err = MSVCRT__errno();
if(dp-1 > MSVCRT_DBL_MAX_10_EXP)
return make_double(sign, INT_MAX, 1, ROUND_ZERO, err);
/* Count part of exponent stored in denormalized mantissa. */
diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c
index ccbd049c4c..8a2d678b63 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -1976,7 +1976,6 @@ static void test__strtod(void)
ok(d == tests[i].ret, "%d) d = %.16e\n", i, d);
ok(end == tests[i].str + tests[i].len, "%d) len = %d\n",
i, (int)(end - tests[i].str));
- todo_wine_if(!tests[i].err)
ok(errno == tests[i].err, "%d) errno = %d\n", i, errno);
}
--
2.25.1
More information about the wine-devel
mailing list