/*
 * From the list pointed to by *user_ptr_del, delete the user
 * with the given name.
 * Remove the deleted user from any lists of friends.
 *
 * Return:
 *   - 0 on success.
 *   - 1 if a user with this name does not exist.
 */
int delete_user(const char *name, User **user_ptr_del) {
    if (find_user(name, *user_ptr_del) == NULL) {  // don't think this is right help
        return 1;
    }

    // user_ptr_del is a pointer to a user pointer

    // at the point, user exists    
    
    User *prev = *user_ptr_del;
    User *curr = prev->next;

    // special case, when there is only one element
    if (curr = NULL) {
        free(prev->first_post); // need to loop
        prev = NULL;
        free(prev);
    }
    
    while (curr != NULL) {
        // deleting head of list
        if (prev->name == name) {
            prev->next = NULL;
            free(prev->first_post); // need to loop
            free(prev);
        }
        
        if (curr->name != name) {
            prev->next = curr;
            curr = curr->next;
        }
delete user with given name using prev and curr