does the code do the following: add second user to the first user's friend list and add first user to the second user's friends list if both exist and their friend's list is not at a maximum of 10 and they're not already friends


int make_friends(const char *name1, const char *name2, User *head) {
    int error;
    if (strcmp(name1, name2) == 0){
        error = 3;
    }
    // if (head == NULL){
    //     return 4;
    // }
    // else{
    //     if (head->next == NULL){
    //         if (strcmp(head->name, name1) != 0){
    //             return 4;
    //         }
    //     }
    User *first_user = find_user(name1, head);
    User *second_user = find_user(name2, head);

    if (first_user == NULL || second_user == NULL){
        return 4;
        }


    if ((first_user->friends[9] != NULL) && (second_user->friends[9] != NULL)){
             for (int i = 0; i < 9; i++){
                if((strcmp(first_user->friends[i]->name, second_user->name)==0) && (first_user->friends[i] != NULL)){
                    if (error < 1){
                        error = 1;
                    } 
                }
                else{
                    // add to each friend's lst
                    int stop1 = 0;
                    if (stop1 == 0){
                        first_user->friends[i] = second_user;
                        stop1 = 1;
                        error = 0;
                    }
                    
                }

                   
            }
            for (int j = 0; j < 9; j++){
                if((strcmp(second_user->friends[j]->name, first_user->name) == 0) && second_user->friends[j] != NULL){
                    if (error < 1){
                        error = 1;
                    } 
                }
                else{
                    // add to each friend's lst
                    int stop = 0;
                    if (stop == 0){
                        second_user->friends[j] = first_user;
                        stop = 1;
                        error = 0;
                    }            
                }               
            }
    else {
            if (error < 2){
                error = 2;
            }
        }

    fprintf(stdout, "%s\n", first_user->friends[0]->name);
    fprintf(stdout, "%s\n", second_user->friends[0]->name);

    if (error != 0){
        return error;
    }
    return 0;
}
