> recivi=recv(*sock, buff, sizeof(buff), 0);
You only send 4 bytes down the socket. Why are you trying to read 30?Replace with:Code:char *passpointer; int hasnull; int letras; passpointer = buff; for(i=0;i<strlen(buff)+1;i++) { if(passpointer != '\0') { passpointer++; letras++; } else { hasnull=1; } } printf("has null?: %i Letras: %i\n", hasnull, letras);Code:printf("has null?: yes, eventually Letras: %lu\n", (unsigned long) strlen(buff));