]> git.saurik.com Git - wxWidgets.git/commitdiff
Stupid bug in GAddress initialization prevented BCC to work. (I still
authorGuillermo Rodriguez Garcia <guille@iies.es>
Wed, 27 Oct 1999 10:44:40 +0000 (10:44 +0000)
committerGuillermo Rodriguez Garcia <guille@iies.es>
Wed, 27 Oct 1999 10:44:40 +0000 (10:44 +0000)
wonder how this could work with other compilers :-( ...)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4209 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/gsocket.c

index 88e8c99a5ce083e9023d12a341330bdf9f27337b..729886938afbcb8ff876bce54fa8590bee3705ed 100644 (file)
@@ -1164,6 +1164,7 @@ GSocketError _GAddress_translate_to(GAddress *address,
 
 GSocketError _GAddress_Init_INET(GAddress *address)
 {
+  address->m_len = sizeof(struct sockaddr_in);
   address->m_addr = (struct sockaddr *) malloc(address->m_len);
   if (address->m_addr == NULL)
   {
@@ -1171,7 +1172,6 @@ GSocketError _GAddress_Init_INET(GAddress *address)
     return GSOCK_MEMERR;
   }
 
-  address->m_len = sizeof(struct sockaddr_in);
   address->m_family = GSOCK_INET;
   address->m_realfamily = PF_INET;
   ((struct sockaddr_in *)address->m_addr)->sin_family = AF_INET;