Fix tcphost option

This commit is contained in:
Rodrigo Laneth 2024-11-11 20:52:56 -03:00
parent bb4b1917d5
commit 9037d23991
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

2
TCP.c
View File

@ -21,7 +21,7 @@ int open_tcp(char* ip, int port) {
memset(&serv_addr, 0, sizeof(serv_addr)); memset(&serv_addr, 0, sizeof(serv_addr));
serv_addr.sin_family = AF_INET; 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); serv_addr.sin_port = htons(port);
if (connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) { if (connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) {