void list_posts(const Post *curr) {
    // cast a (const Post *) to a (Post *)
    Post *current = (Post *) curr;

    while (current != NULL){
        // print to standard output
        printf("From: %s\n", current->author);
        printf("Date: %s\n", ctime(current->date));
        printf("%s\n", current->contents);

        if (current->next != NULL)
        {
            printf("\n");
            printf("===\n");
            printf("\n");
        }

        current = current->next;
    }

}
this code is causing segmentation fault with ./time/localtime.c: No such file or directory.
how can i fix it?