why is this getting a segmentation fault?
int make_post(const User *author, User *target, char *contents) {
    // Test if either author or target doesn't exist
    if (author == NULL || target == NULL) {
        return 2;
    }

    // Create post
    Post *p = malloc(sizeof(Post));  // Allocate memory
    strcpy(p->author, author->name);  // Author
    strcpy(p->contents, contents);  // Contents
    time(p->date);  // Date

    // Insert the new post at the beginning of recipient's post list
    p->next = target->first_post;
    target->first_post = p;

    return 0;
}