diff --git a/img.c b/img.c index 3fec01b10bc6403d6be0de13fbc6aacc5b571c7b..79bbeb34f75a17c5919ae38d8eeb907fefa17ed5 100644 --- a/img.c +++ b/img.c @@ -172,7 +172,8 @@ struct User* the_other_user(struct User* curr_user, struct User* user_arr[]){ // try to match the new guess to the other user keywords bool match(char* w1, char** w2, int n_word){ for (int i=0; i<n_word; i++){ - if (w2[i]==w1){ + printf("%s - %s \n", w1, w2[i]); + if (strcmp(w1, w2[i])==0){ printf("all good"); return true; } @@ -408,7 +409,7 @@ static bool handle_http_request(int sockfd, struct User* user_arr[]) record_keyword(curr_user, guess); char guess_buff[MAX_BUFF]; - strcpy(guess_buff,"<br>"); + strcpy(guess_buff,","); if(curr_user->n_word==1) { @@ -421,7 +422,7 @@ static bool handle_http_request(int sockfd, struct User* user_arr[]) for (int i = 0; i < curr_user->n_word; ++i) { strcat(guess_buff, curr_user->keywords[i]); - strcat(guess_buff,"<br>"); + strcat(guess_buff,","); } } edit_load_html("4_accepted.html", sockfd,buff,guess_buff,curr_user);