]> git.saurik.com Git - wxWidgets.git/commitdiff
switching to host / network ordering swapping
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 18 Apr 2004 16:37:16 +0000 (16:37 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 18 Apr 2004 16:37:16 +0000 (16:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26859 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/ftp.cpp
src/common/sckaddr.cpp

index 83f419d5462d81d73abcec7c31979ed786b5f74f..5edc4b2e8bc775ec19be6c3b8d5407bc60baa29f 100644 (file)
@@ -596,10 +596,10 @@ wxSocketClient *wxFTP::GetPort()
     wxSscanf(straddr, wxT("%d,%d,%d,%d,%d,%d"),
              &a[2],&a[3],&a[4],&a[5],&a[0],&a[1]);
 
     wxSscanf(straddr, wxT("%d,%d,%d,%d,%d,%d"),
              &a[2],&a[3],&a[4],&a[5],&a[0],&a[1]);
 
-    wxUint32 hostaddr = (wxUint16)a[5] << 24 |
-                        (wxUint16)a[4] << 16 |
-                        (wxUint16)a[3] << 8 |
-                        a[2];
+    wxUint32 hostaddr = (wxUint16)a[2] << 24 |
+                        (wxUint16)a[3] << 16 |
+                        (wxUint16)a[4] << 8 |
+                        a[5];
     wxUint16 port = (wxUint16)a[0] << 8 | a[1];
 
     wxIPV4address addr;
     wxUint16 port = (wxUint16)a[0] << 8 | a[1];
 
     wxIPV4address addr;
index 3ac7e22d9f2555f3e3abb18b3e79d630198669be..f158a557682af8a0b7daf16413039a49aa181ed8 100644 (file)
@@ -211,10 +211,10 @@ wxString wxIPV4address::IPAddress() const
        unsigned long raw =  GAddress_INET_GetHostAddress(m_address);
        return wxString::Format(
                _T("%u.%u.%u.%u"),
        unsigned long raw =  GAddress_INET_GetHostAddress(m_address);
        return wxString::Format(
                _T("%u.%u.%u.%u"),
-               (unsigned char)(raw & 0xff),
-               (unsigned char)((raw>>8) & 0xff),
+               (unsigned char)((raw>>24) & 0xff),
                (unsigned char)((raw>>16) & 0xff),
                (unsigned char)((raw>>16) & 0xff),
-               (unsigned char)((raw>>24) & 0xff)
+               (unsigned char)((raw>>8) & 0xff),
+               (unsigned char)(raw & 0xff)
                );
 }
 
                );
 }
 
@@ -288,10 +288,10 @@ wxString wxIPV6address::IPAddress() const
        unsigned long raw =  GAddress_INET_GetHostAddress(m_address);
        return wxString::Format(
                _T("%u.%u.%u.%u"),
        unsigned long raw =  GAddress_INET_GetHostAddress(m_address);
        return wxString::Format(
                _T("%u.%u.%u.%u"),
-               (unsigned char)(raw & 0xff),
-               (unsigned char)((raw>>8) & 0xff),
+               (unsigned char)((raw>>24) & 0xff),
                (unsigned char)((raw>>16) & 0xff),
                (unsigned char)((raw>>16) & 0xff),
-               (unsigned char)((raw>>24) & 0xff)
+               (unsigned char)((raw>>8) & 0xff),
+               (unsigned char)(raw & 0xff)
                );
 }
 
                );
 }