int delete_user(const char *name, User **user_ptr_del) {
    User *temp = *user_ptr_del;
    if (strcmp((*user_ptr_del)->name, name) == 0){
            for (int i = 0; i < MAX_FRIENDS; i++){
                    while ((*user_ptr_del)->friends[i] != NULL){
                        for (int j = 0; j < MAX_FRIENDS; j++){
                                while ((*user_ptr_del)->friends[i]->friends[j] != NULL){
                                if (strcmp(((*user_ptr_del)->friends[i]->friends[j]->name), name)== 0){
                                        (*user_ptr_del)->friends[i]->friends[j] = (*user_ptr_del)->friends[i]->friends[j+1];
                                        }
                                }
                        }
                    }
                (*user_ptr_del) = (*user_ptr_del)->next;
                *user_ptr_del = temp;
                return 0;
                }
           *user_ptr_del = (*user_ptr_del)->next;
    } else {
        while ((*user_ptr_del)->next != NULL){
            if (strcmp((*user_ptr_del)->next->name, name) == 0){
                for (int i = 0; i < MAX_FRIENDS; i++){
                        while ((*user_ptr_del)->next->friends[i] != NULL){
                                for (int j = 0; j < MAX_FRIENDS; j++){
                                        while ((*user_ptr_del)->next->friends[i]->friends[j] != NULL){
                                        if (strcmp((*user_ptr_del)->next->friends[j]->name, name)== 0){
                                        (*user_ptr_del)->next->friends[j] = (*user_ptr_del)->next->friends[j+1];
                                }
                        }}
                }}
                (*user_ptr_del)->next = (*user_ptr_del)->next->next;
                (*user_ptr_del) = temp;
                return 0;
            }
        *user_ptr_del = (*user_ptr_del)->next;
        }
    }
    return 0;
}

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.