is there a problem with my code?
int make_friends(const char *name1, const char *name2, User *head) {
    // check if same user name is passed in 2x 
    if (strcmp(name1, name2) == 0){
        error = 3;

    }
    else{ 
           // check if there's 0 / one user -> user DNE
           if (head == NULL){
            return 4;
           }
           else if (head->next == NULL){
            return 4;
           }
        
           else{ // more than one users in lst
            int error;
            User *prev1 = head;
            User *curr1 = head->next;
            User *first_user;

            while (curr1->next != NULL){
                // check if user1 / user 2 is in the list
                if (strcmp(prev1->name, name1)==0){
                    if (prev1->friends[10] != NULL){
                        return 2;
                    }
                    first_user = prev1;
                }
                prev1 = curr1;
                curr1 = curr1->next;
            }
           
            User *prev = head;
            User *curr = head->next;
            User *second_user;


            while (curr->next != NULL){
                // check if user1 / user 2 is in the list
                if (strcmp(prev->name, name1)==0){
                    if (prev->friends[10] != NULL){
                        return 2;
                    }
                    second_user = prev;
                }
                
                prev = curr;
                curr = curr->next;
           }
           if ((first_user->friends[10] != NULL) && (second_user->friends[10] != NULL)){
                for (int i = 0; i < 10; i++){
                    if(first_user->friends[i] == second_user){
                        return 1;
                    }
                    if (first_user->friends[i] == NULL){
                        first_user->friends[i] = second_user;
                    }
                }
                for (int j = 0; j < 10; j++){
                    if(second_user->friends[j] == first_user){
                        error = 1;
                    }
                    if (second_user->friends[j] == NULL){
                        second_user->friends[j] = first_user;
                    }
                }


           }
           return 0;
    }
    }
}

    