1
0

Fixed cast to type with different alignment in BlockingTCPLink

This commit is contained in:
Tycho 2014-03-10 10:38:21 -07:00
parent 8665233522
commit e2e7f2184f

View File

@ -70,7 +70,7 @@ bool cBlockingTCPLink::Connect(const char * iAddress, unsigned int iPort)
} }
} }
server.sin_addr.s_addr = *((unsigned long *)hp->h_addr); memcpy(&server.sin_addr.s_addr,hp->h_addr, hp->h_length);
server.sin_family = AF_INET; server.sin_family = AF_INET;
server.sin_port = htons( (unsigned short)iPort); server.sin_port = htons( (unsigned short)iPort);
if (connect(m_Socket, (struct sockaddr *)&server, sizeof(server))) if (connect(m_Socket, (struct sockaddr *)&server, sizeof(server)))