Fixed error. undeclared variable.

This commit is contained in:
Afonso Clerigo Mendes de Sousa 2025-02-28 22:03:23 +00:00
parent 5dc71aaa04
commit e319dc6750
2 changed files with 4 additions and 2 deletions

Binary file not shown.

View File

@ -15,6 +15,8 @@
#define SERVER_IP "192.168.1.120" #define SERVER_IP "192.168.1.120"
#define PASSWORDS "./files/USER_PASSWORDS_L" #define PASSWORDS "./files/USER_PASSWORDS_L"
int sockfd;
typedef struct Request typedef struct Request
{ {
unsigned char type; unsigned char type;
@ -68,7 +70,7 @@ void *handle_client(void *arg)
{ {
fprintf(stderr, "Memory allocation failed\n"); fprintf(stderr, "Memory allocation failed\n");
close(sockfd); close(sockfd);
return 1; return NULL;
} }
end_try; end_try;
@ -190,7 +192,7 @@ void *handle_client(void *arg)
int main(void) int main(void)
{ {
// Connect and bind to a port (8080) on the server // Connect and bind to a port (8080) on the server
int sockfd = socket(AF_INET, SOCK_STREAM, 0); sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd == -1) if (sockfd == -1)
{ {
fprintf(stderr, "Socket creation failed\n"); fprintf(stderr, "Socket creation failed\n");