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

    int friends = 0;
    for (int i = 0; i < MAX_FRIENDS && target->friends[i] != NULL; i++)
    {
        if (strcmp(target->friends[i]->name, author->name) == 0)
        {
            friends = 1;
            break;
        }
    }

    if (friends == 0)
    {
        return 1;
    }

    /*Creating a post. allocates memory for a post and stores the address in 
    new_post */
    Post *newlyPosted = malloc(sizeof(Post));

    //checks if new post is NULL.
    if (newlyPosted == NULL)
    {
        perror("malloc couldn't allocate memory");
        exit(1);
    }
    strncpy(newlyPosted->author, author->name, MAX_NAME);
    newlyPosted->contents = contents;
    newlyPosted->date = malloc(sizeof(time_t));
    if (newlyPosted->date == NULL)
    {
        perror("malloc couldn't allocate memory");
        exit(1);
    }
    time(newlyPosted->date);

    newlyPosted->next = target->first_post;
    target->first_post = newlyPosted;
    

    return 0;
}
Make a new post from 'author' to the 'target' user, * containing the given contents, IF the users are friends. * * Insert the new post at the *front* of the user's list of posts. * * 'contents' is a pointer to heap-allocated memory - you do not need * to allocate more memory to store the contents of the post. * * Return: * - 0 on success * - 1 if users exist but are not friends * - 2 if either User pointer is NULL */