char str[1000];
FILE *fptr;
fptr = fopen(user->profile_pic,"r");
if(fptr != NULL){
    if(fgets(str, 1000, fptr) != NULL){
        printf("%s",str);
    }
}
fclose(fptr);
How to fix segmentation fault?