how to fix error for new_post->author = author->name

int make_post(const User *author, User *target, char *contents) {
        if (author == NULL || target == NULL) {
        return 2;
    }
        if (check_friends((User *)author, target) == 1) {
                return 1;
        }

        Post *new_post = malloc(sizeof(Post));
        new_post->author = author->name;
        new_post->contents = contents;

        time_t curtime;
        new_post->date = &curtime;
        new_post->next = target->first_post->next;
        target->first_post = new_post;

        return 0;
}