Michael Stefaniuc : msvcrt: Clarify comparison of the diff of two unsigneds with 0 (PVS-Studio).

Alexandre Julliard julliard at wine.codeweavers.com
Fri Mar 6 06:27:28 CST 2015


Module: wine
Branch: master
Commit: 278b70bdd0d765de2976922c3d73202f5eded5eb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=278b70bdd0d765de2976922c3d73202f5eded5eb

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Fri Mar  6 10:07:59 2015 +0100

msvcrt: Clarify comparison of the diff of two unsigneds with 0 (PVS-Studio).

---

 dlls/msvcrt/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index 2e473a9..f803f5d 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -4254,7 +4254,7 @@ MSVCRT_size_t CDECL MSVCRT__fread_nolock_s(void *buf, MSVCRT_size_t buf_size, MS
             if(c == EOF)
                 break;
 
-            if(!MSVCRT_CHECK_PMT_ERR(buf_size-buf_pos > 0, MSVCRT_ERANGE)) {
+            if(!MSVCRT_CHECK_PMT_ERR(buf_size != buf_pos, MSVCRT_ERANGE)) {
                 memset(buf, 0, buf_size);
                 return 0;
             }




More information about the wine-cvs mailing list