Juan Lang : wininet: Use sizeof(member) rather than sizeof(type) for address lengths.

Alexandre Julliard julliard at winehq.org
Fri Jul 10 08:52:04 CDT 2009


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Thu Jul  9 11:04:33 2009 -0700

wininet: Use sizeof(member) rather than sizeof(type) for address lengths.

---

 dlls/wininet/ftp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c
index 75bf69c..6d41ac5 100644
--- a/dlls/wininet/ftp.c
+++ b/dlls/wininet/ftp.c
@@ -2807,7 +2807,7 @@ lend:
 static BOOL FTP_InitListenSocket(LPWININETFTPSESSIONW lpwfs)
 {
     BOOL bSuccess = FALSE;
-    socklen_t namelen = sizeof(struct sockaddr_in);
+    socklen_t namelen = sizeof(lpwfs->lstnSocketAddress);
 
     TRACE("\n");
 
@@ -2824,7 +2824,7 @@ static BOOL FTP_InitListenSocket(LPWININETFTPSESSIONW lpwfs)
     /* and get the system to assign us a port */
     lpwfs->lstnSocketAddress.sin_port = htons(0);
 
-    if (bind(lpwfs->lstnSocket,(struct sockaddr *) &lpwfs->lstnSocketAddress, sizeof(struct sockaddr_in)) == -1)
+    if (bind(lpwfs->lstnSocket,(struct sockaddr *) &lpwfs->lstnSocketAddress, sizeof(lpwfs->lstnSocketAddress)) == -1)
     {
         TRACE("Unable to bind socket\n");
         goto lend;




More information about the wine-cvs mailing list