Skip to content
Snippets Groups Projects
Commit 22fba9ec authored by Terence Denning's avatar Terence Denning
Browse files

fixed segfault resignment of current guesses

parent 882aac1a
Branches
No related tags found
No related merge requests found
......@@ -56,6 +56,8 @@ static char *user2_name = "";
static int user2_start = 0;
char user2_guesses[100][100];
int user2_guess_number = 0;
char *user1_current_guesses;
char *user2_current_guesses;
int gameover = 0;
......@@ -249,7 +251,6 @@ static bool handle_http_request(int sockfd)
webpage = "html/5_discarded.html";
}
} else {
printf("user1: %d, user2: %d\n", user1, user2);
webpage = "html/6_endgame.html";
}
......@@ -287,9 +288,6 @@ static bool handle_http_request(int sockfd)
if( strcmp(webpage, "html/4_accepted.html") == 0 ){
char *user1_current_guesses;
char *user2_current_guesses;
if(sockfd == user1){
for(int i=0; i<100; i++){
if( strlen(user1_guesses[i]) > 0 ){
......@@ -306,8 +304,6 @@ static bool handle_http_request(int sockfd)
printf("User1 guesses: %s, User2 guesses: %s\n", user1_current_guesses, user2_current_guesses);
}
if((strlen(username) > 0) && (strstr(buff, "user=") != NULL) ){
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment