msvcirt: Avoid superfluous comparison in some compilers

Iván Matellanes matellanesivan at gmail.com
Sun Mar 27 06:57:45 CDT 2016


For https://bugs.winehq.org/show_bug.cgi?id=40135

Signed-off-by: Iván Matellanes <matellanesivan at gmail.com>
---
 dlls/msvcirt/msvcirt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c
index 09f488a..51ea5b6 100644
--- a/dlls/msvcirt/msvcirt.c
+++ b/dlls/msvcirt/msvcirt.c
@@ -1383,7 +1383,7 @@ streampos __thiscall strstreambuf_seekoff(strstreambuf *this, streamoff offset,
 
     TRACE("(%p %d %d %d)\n", this, offset, dir, mode);
 
-    if (dir < SEEKDIR_beg || dir > SEEKDIR_end || !(mode & (OPENMODE_in|OPENMODE_out)))
+    if ((dir != SEEKDIR_beg && dir != SEEKDIR_cur && dir != SEEKDIR_end) || !(mode & (OPENMODE_in|OPENMODE_out)))
         return EOF;
     /* read buffer */
     if (mode & OPENMODE_in) {
-- 
2.5.0




More information about the wine-patches mailing list