
int make_post(const User *author, User *target, char *contents) {
    if (author == NULL || target == NULL){
        return 2;
    }
    int friends = 0;
    for (int j = 0; j < 10; j++){
        // doing this for author cuz if they're friends - it's symmetric
        if (target->friends[j] != NULL && strcmp(target->friends[j]->name, author->name) == 0){
            friends = 1;
        }
        friends += 0;
    }
    if (friends != 0){ // means that they are not friends
     // create new post struct as they are friends
        Post *new_post = malloc(sizeof(Post));
        strcpy(new_post->author, author->name);
        strcpy(new_post->contents, contents);   
       
       time_t local_time;
       time(&local_time);
       new_post->date = &local_time;
    
        if (target->first_post == NULL){
            target->first_post = new_post;
        }
        Post *curr = target->first_post;
        target->first_post = new_post;
        new_post->next = curr;
        
        return 0;

    }
    return 1;   
    
}
why segmentation fault?