should temp be allocated size user or user *
void remove_friends(const char *name, User **ptr_users) {
    User *curr = *ptr_users;
    while (curr != NULL) {
        int f_count = 0;
        int u_count = 0;
        for (int i = 0; i < MAX_FRIENDS; i++) {
            if (curr->friends[i] != NULL) {
                f_count++;

                if (strcmp(curr->friends[i]->name, name) == 0) {
                    u_count = f_count;
                }
            }
        }

        for (int x = u_count; x < f_count - 1; x++) {
            curr->friends[x] = curr->friends[x + 1];
        }

        curr->friends[f_count - 1] = NULL;

        curr = curr->next;
    }

}
int delete_user(const char *name, User **user_ptr_del) {

    // Delete user from list
    User *curr = *user_ptr_del;
    User *temp = malloc(sizeof(User));

    if (*user_ptr_del == NULL) {
        return 1;
    }

    // If 1 element in the list
    if (curr->next == NULL) {
        if (strcmp(curr->name, name) == 0) {
            temp = curr;
            *user_ptr_del = NULL;
            free(temp);
            return 0;
        } else {
            return 1;
        }
    }

    // If 1st element is removed
    if (strcmp(curr->name, name) == 0) {
        temp = curr;
        *user_ptr_del = curr->next;
        free(temp);
        return 0;
    }

    while (strcmp(curr->next->name, name) != 0 && curr->next != NULL) {
        curr = curr->next;
    }
    // If name does not exist
    if (curr->next == NULL) {
        return 1;
    }
    // If user to be removed is the last one
    if (curr->next->next == NULL) {
        temp = curr->next;
        curr->next = NULL;
    } else {
        // If user to be removed is in the middle of the list
        temp = curr->next;
        curr->next = curr->next->next;
    }
    remove_friends(name, user_ptr_del);
    free(temp);
    return 0;
}
