diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-10-11 16:25:17 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-10-11 16:25:17 (GMT) |
commit | d4f1785473418478b5c69316ed2a4101a1789f6b (patch) | |
tree | 63c142f3a0355e29a22344b9d792efc4a12bfd30 | |
parent | 1ed5888d917c1b846c85e9204a6837b39c885f63 (diff) | |
download | CMake-d4f1785473418478b5c69316ed2a4101a1789f6b.zip CMake-d4f1785473418478b5c69316ed2a4101a1789f6b.tar.gz CMake-d4f1785473418478b5c69316ed2a4101a1789f6b.tar.bz2 |
COMP: Remove alignment warning
-rw-r--r-- | Source/CTest/Curl/url.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/CTest/Curl/url.c b/Source/CTest/Curl/url.c index 89dcf0f..63ce697 100644 --- a/Source/CTest/Curl/url.c +++ b/Source/CTest/Curl/url.c @@ -1900,7 +1900,10 @@ static int handleSock5Proxy(const char *proxy_name, } } - *((unsigned short*)&socksreq[8]) = htons(conn->remote_port); + { + unsigned short s = htons(conn->remote_port); + memcpy(socksreq+8, &s, sizeof(unsigned short)); + } { const int packetsize = 10; @@ -1923,11 +1926,14 @@ static int handleSock5Proxy(const char *proxy_name, return 1; } if (socksreq[1] != 0) { /* Anything besides 0 is an error */ + unsigned short sh; + memcpy(&sh, socksreq+8, sizeof(unsigned short)); + failf(conn->data, "Can't complete SOCKS5 connection to %d.%d.%d.%d:%d. (%d)", (unsigned char)socksreq[4], (unsigned char)socksreq[5], (unsigned char)socksreq[6], (unsigned char)socksreq[7], - (unsigned int)ntohs(*(unsigned short*)(&socksreq[8])), + (unsigned int)ntohs(sh), socksreq[1]); return 1; } |