From f5d3ba5888ce8474a001ff975a7b5163d1e5c2ec Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Mon, 17 Jul 2017 22:33:53 -0600 Subject: [PATCH] msvcrt: Don't set errno in log functions if x is positive infinity. Signed-off-by: Alex Henrie Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcrt/math.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 637f9208c38..b030a63c4a6 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -225,10 +225,10 @@ float CDECL MSVCRT_fmodf( float x, float y ) /********************************************************************* * MSVCRT_logf (MSVCRT.@) */ -float CDECL MSVCRT_logf( float x) +float CDECL MSVCRT_logf( float x ) { - if (x < 0.0 || !finitef(x)) *MSVCRT__errno() = MSVCRT_EDOM; - if (x == 0.0) *MSVCRT__errno() = MSVCRT_ERANGE; + if (x < 0.0) *MSVCRT__errno() = MSVCRT_EDOM; + else if (x == 0.0) *MSVCRT__errno() = MSVCRT_ERANGE; return logf(x); } @@ -237,8 +237,8 @@ float CDECL MSVCRT_logf( float x) */ float CDECL MSVCRT_log10f( float x ) { - if (x < 0.0 || !finitef(x)) *MSVCRT__errno() = MSVCRT_EDOM; - if (x == 0.0) *MSVCRT__errno() = MSVCRT_ERANGE; + if (x < 0.0) *MSVCRT__errno() = MSVCRT_EDOM; + else if (x == 0.0) *MSVCRT__errno() = MSVCRT_ERANGE; return log10f(x); } @@ -420,10 +420,10 @@ double CDECL MSVCRT_fmod( double x, double y ) /********************************************************************* * MSVCRT_log (MSVCRT.@) */ -double CDECL MSVCRT_log( double x) +double CDECL MSVCRT_log( double x ) { - if (x < 0.0 || !isfinite(x)) *MSVCRT__errno() = MSVCRT_EDOM; - if (x == 0.0) *MSVCRT__errno() = MSVCRT_ERANGE; + if (x < 0.0) *MSVCRT__errno() = MSVCRT_EDOM; + else if (x == 0.0) *MSVCRT__errno() = MSVCRT_ERANGE; return log(x); } @@ -432,8 +432,8 @@ double CDECL MSVCRT_log( double x) */ double CDECL MSVCRT_log10( double x ) { - if (x < 0.0 || !isfinite(x)) *MSVCRT__errno() = MSVCRT_EDOM; - if (x == 0.0) *MSVCRT__errno() = MSVCRT_ERANGE; + if (x < 0.0) *MSVCRT__errno() = MSVCRT_EDOM; + else if (x == 0.0) *MSVCRT__errno() = MSVCRT_ERANGE; return log10(x); } -- 2.11.4.GIT