what can i do to fix this so that a user is removed from the friendslist of all users
void remove_friend(const char *name, User *ptr_friend_user, int index) {
    User *friend = ptr_friend_user;
    for (int i = index; i < MAX_FRIENDS - 1; i++) {
        friend->friends[i] = friend->friends[i + 1];
    }
    friend->friends[MAX_FRIENDS - 1] = NULL;
}

void remove_friends(const char *name, User **ptr_users) {
    User *curr = *ptr_users;
    while (curr != NULL) {
        for (int i = 0; i < MAX_FRIENDS; i++) {
            if (strcmp(curr->friends[i]->name, name) == 0) {
                remove_friend(name, curr, i);
            }
        }
        curr = curr->next;
    }

}