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;

typedef struct post {
    char author[MAX_NAME];
    char *contents;
    time_t *date;
    struct post *next;
} Post;




int delete_user(const char *name, User **user_ptr_del) {
    // the first user in this list
    User *current_user = *user_ptr_del;
    User *prev = NULL;
    User *found_user = NULL;
    
    while (current_user != NULL)
    {
        if (strcmp(name, current_user->name) == 0)
        {
            found_user = current_user;
            break;
        }
        prev = current_user;
        current_user = current_user->next;
    }

    // return 1 of a user with this name does not exist
    if (found_user == NULL)
    {
        return 1;
    }else{
        // make the next of prev be the next of found_user
            prev->next = found_user->next;
    }

    // free user's posts list
    // free_users_post_list(found_user->first_post);

    // free each friend
    for (int i = 0; i < MAX_FRIENDS; i++) {
        if (found_user->friends[i] == NULL) {
            break;
        }
        // remove the deleted user from friend list of this friend
        for (int j = 0; j < MAX_FRIENDS; j++) {
            // free post from this user in friends' post lists
            free_post_from_author(name, found_user->friends[i]);
            if (strcmp((char *)(found_user->friends)[i]->friends[j]->name, name) == 0)
            {
                found_user->friends[i]->friends[j - 1]->next = found_user->friends[i]->friends[j + 1];
            }
        }
    }
    free(found_user->friends);

    // free the user
    free(found_user);

    // return 0 on success
    return 0;
}
in the function delete_user strcmp in line 57 is causing segmentation fault