ws2_32: Fix TRACE format in WS_getsockname (try 2)

Bruno Jesus 00cpxxx at gmail.com
Sun Sep 30 22:30:06 CDT 2012


(try2)
Also avoids the possibility of reading from NULL ptr using the same
solution from WS_getpeername.

(original)
This is the only %8x in the file, all others are %08x. It feels weird
to see in the log:

trace:winsock:WS_getsockname socket: 0064, ptr 0xd82530, len       1c
trace:winsock:WS_getpeername socket: 0064, ptr 0xd8254c, len 0000001c
-------------- next part --------------
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index ca5d0e4..7b86ca4 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -2444,7 +2444,7 @@ int WINAPI WS_getsockname(SOCKET s, struct WS_sockaddr *name, int *namelen)
     int fd;
     int res;
 
-    TRACE("socket: %04lx, ptr %p, len %8x\n", s, name, *namelen);
+    TRACE("socket: %04lx, ptr %p, len %08x\n", s, name, namelen?*namelen:0);
 
     /* Check if what we've received is valid. Should we use IsBadReadPtr? */
     if( (name == NULL) || (namelen == NULL) )


More information about the wine-patches mailing list