I missed something but I've corrected it, and its more confusing now
In the client
Code:
unsigned long sending;
sending=send(sock, password, strlen(password)+1, 0);
printf("Sending: %lu \n", sending);
int intbuf;
recv(sock, intbuf, sizeof(intbuf), 0);
printf("Recibi: %i \n", intbuf);
int buf2;
//password check has been removed due it always says its correct ¬¬
printf("Password ok..\n");
It's printing
Sending: 4
Recibi: -1208592900
Password ok..
And the server
Code:
unsigned long passlen;
unsigned long serverpasslen;
unsigned long recivi;
serverpasslen = strlen(password);
recivi=recv(*sock, buff, sizeof(buff), 0);
passlen = strlen(buff);
printf("Client Passwd: %s and lenght: %lu\n", buff, passlen);
printf("Recivi: %lu \n", recivi);
printf("Server Passwd: %s and lenght: %lu \n", password, serverpasslen);
printf("Que da el cmp: %i \n", strcmp(password, buff));
It's printing
Client Passwd: lol and lenght: 3
Recivi: 4
Server Passwd: lol and lenght: 3
Que da el cmp: 0
Password incorrecta