Signed-off-by: Daniel Lehman dlehman25@gmail.com --- dlls/msvcrt/string.c | 2 +- dlls/msvcrt/tests/string.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index cf4fc65ff4..ff1195e19b 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -423,7 +423,7 @@ static double make_double(int sign, int exp, ULONGLONG m, enum round round, int } }
- if (exp >= 1<<EXP_BITS) + if (exp >= (1<<EXP_BITS)-1) { if (err) *err = MSVCRT_ERANGE; return sign * INFINITY; diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c index 8a2d678b63..ad41ad4d24 100644 --- a/dlls/msvcrt/tests/string.c +++ b/dlls/msvcrt/tests/string.c @@ -1956,7 +1956,12 @@ static void test__strtod(void) { "0.1d238", 7, 0.1e238 }, { "0.1D-4736", 9, 0, ERANGE }, { "3.4028234663852887e38", 21, FLT_MAX }, + { "1.1754943508222875e-38", 22, FLT_MIN }, { "1.7976931348623158e+308", 23, DBL_MAX }, + { "1.7976931348623159e+308", 23, INFINITY, ERANGE }, + { "2.2250738585072014e-308", 23, DBL_MIN }, + { "-1.7976931348623158e+308", 24, -DBL_MAX }, + { "-1.7976931348623159e+308", 24, -INFINITY, ERANGE }, { "00", 2, 0 }, { "00.", 3, 0 }, { ".00", 3, 0 },