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

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;

int make_post(const User *author, User *target, char *contents) {
    int i;
    for(i = 0; i < MAX_FRIENDS; i++){
        if((target->friends)[i] == author){
            Post *pst = malloc(sizeof(Post));
            strncpy(pst->author, author->name, MAX_NAME);
            pst->contents = contents;
            time_t now;
            time(&now);
            pst->date = &now;

            pst->next = target->first_post;
            target->first_post = pst;
        }
    }
    return -1;
}

int print_user(const User *user) {
    if (user == NULL){
        return 1;
    }

    FILE *f = fopen(user->profile_pic, "r");
    if(f != NULL){
        char c = fgetc(f);
        while(c != EOF){
            printf("%c", c);
            c = fgetc(f);
        }
        fclose(f);
    }

    printf("Name: %s\n", user->name);
    printf("------------------------------------------\n");
    printf("Friends:\n");

    int i;
    for(i = 0; i < MAX_FRIENDS; i++){
        if(user->friends[i] != NULL){
            printf("%s\n", user->friends[i]->name);
        }
        else{
            break;
        }
    }

    printf("------------------------------------------\n");
    printf("Posts:\n");

    Post *curr_post = user->first_post;
    while(curr_post != NULL){
        printf("From: %s\n", curr_post->author);
        printf("%s\n", ctime(curr_post->date));
        printf("\n");
        printf("%s\n", curr_post->contents);
        printf("\n");
        curr_post = curr_post->next;
        if(curr_post != NULL){
            printf("===");
            printf("\n");
        }
    }

    printf("------------------------------------------\n");
    return 0;
}
why is there a segmentation fault