Why am I getting a segmentation fault from calling this function?
int print_user(const User *user) {
    if(user == NULL) {
        return 1;
    }
    // print user's pfp
    if(user->profile_pic != NULL) {
        // open profile pic file
        FILE *pfp_file = fopen(user->profile_pic, "r");
        // array to hold each line of the ascii file for printing
        char read_pfp[MAX_NAME];
        // if the file exists
        if (pfp_file != NULL) {
            // read until the end of the file
            while (fgets(read_pfp, sizeof(read_pfp), pfp_file) != NULL) {
                printf("%s", read_pfp);
            }
        }
        printf("\n");
        // close file
        fclose(pfp_file);
    }

    printf("Name: %s\n", user->name);
    printf("------------------------------------------\n");
    printf("Friends: \n");
    // print friends in user's friend list
    for(int i=0; i < MAX_FRIENDS; i++) {
        if(((user->friends)[i]) != NULL) {
            printf("%s\n", ((user->friends)[i])->name);
        }
    }
    printf("------------------------------------------\n");
    printf("Posts: \n");
    // print all posts in user's array of posts
/*
    // testing time stuff
    time_t cur_time = time(NULL);
    printf("time: %s\n", ctime(&cur_time));
*/  
    Post *curr_post = user->first_post;
    while(curr_post != NULL) {
        printf("From: %s\n", curr_post->author);
        time_t cur_time = time(curr_post->date);
        printf("Date: %s\n", ctime(&cur_time));
        printf("%s\n", curr_post->contents);
        // print this between posts unless it is the last post
        if(curr_post->next != NULL) {
            printf("\n");
            printf("===\n");
            printf("\n");
        }
        curr_post = curr_post->next;
    }
    printf("------------------------------------------\n");
  
    return 0;
}