What is causing a segmentation fault
int make_post(const User *author, User *target, char *contents) {

    // Check if either User pointer is NULL
    if (author == NULL || target == NULL) {
        return 2;
    }

    // Check if users exist but are not friends
    int found = 0;
    for (int i = 0; i < MAX_FRIENDS; i++) {
        if (target->friends[i] == author) {
            found = 1;
            break;
        }
    }
    if (found == 0) {
        return 1;
    }

    // Make a new post
    Post *new_post = malloc(sizeof(Post));

    strncpy(new_post->author, author->name, MAX_NAME);

    new_post->contents = malloc(strlen(contents));
    strncpy(new_post->contents, contents, strlen(contents));
    free(contents);

    time(new_post->date);
    printf("%s", ctime(new_post->date));

    new_post->next = target->first_post;
    target->first_post = new_post;

    return 0;
}