Fix tcphost option
This commit is contained in:
parent
bb4b1917d5
commit
9037d23991
2
TCP.c
2
TCP.c
|
@ -21,7 +21,7 @@ int open_tcp(char* ip, int port) {
|
|||
memset(&serv_addr, 0, sizeof(serv_addr));
|
||||
serv_addr.sin_family = AF_INET;
|
||||
|
||||
memcpy(server->h_addr, &serv_addr.sin_addr.s_addr, server->h_length);
|
||||
memcpy(&serv_addr.sin_addr.s_addr, server->h_addr, server->h_length);
|
||||
serv_addr.sin_port = htons(port);
|
||||
|
||||
if (connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) {
|
||||
|
|
Loading…
Reference in New Issue