wsock32: Clarify cast operation (PVS-Studio)

Bruno Jesus 00cpxxx at gmail.com
Thu Oct 23 23:10:45 CDT 2014


Partially fix https://bugs.winehq.org/show_bug.cgi?id=37123
-------------- next part --------------
diff --git a/dlls/wsock32/protocol.c b/dlls/wsock32/protocol.c
index 416613a..16109e3 100644
--- a/dlls/wsock32/protocol.c
+++ b/dlls/wsock32/protocol.c
@@ -191,7 +191,7 @@ INT WINAPI EnumProtocolsW(LPINT protocols, LPVOID buffer, LPDWORD buflen)
                 pi[i].dwMessageSize  = wsabuf[i].dwMessageSize;
 
                 memcpy((char *)buffer + string_offset, wsabuf[i].szProtocol, string_size);
-                pi[i].lpProtocol = (WCHAR *)(char *)buffer + string_offset;
+                pi[i].lpProtocol = (WCHAR *)((char *)buffer + string_offset);
                 string_offset += string_size;
             }
             HeapFree(GetProcessHeap(), 0, wsabuf);


More information about the wine-patches mailing list