typedef struct user {
    char name[MAX_NAME];
    char profile_pic[MAX_NAME];  // This is a *filename*, not the file contents.
    struct post *first_post;
    struct user *friends[MAX_FRIENDS];
    struct user *next;
} User;

int delete_user(const char *name, User **user_ptr_del) {
    User *this_user = find_user(name, *user_ptr_del);
    // Case 1: User with this name does not exist
    if (this_user == NULL) {
        return 1;
    }
    // Case 0: Delete user
    // Remove user from each friend's friend list
    int this_user_idx;
    for (int i = 0; i < sizeof(this_user->friends)/sizeof(this_user->friends[0]); i++) {
        // Find the index of this_user
        User *frd = this_user->friends[i];
        for (int j = 0; j < sizeof(frd->friends)/sizeof(frd->friends[0]); j++) {
            if (frd->friends[j] == this_user) {
                this_user_idx = j;
            }
        } printf("%d", this_user_idx);
    }
I keep getting a seg fault in line 22 where I want to take this_user's friend list, loop through each friend, and find this_user's index in the friend's friend list.