fn_list = calloc(strlen(fn_ref) + 5, 1);
strcat(strcpy(fn_list, fn_ref), ".fai");
if (access(fn_list, R_OK) == -1) { // fn_list is unreadable
if (access(fn_ref, R_OK) == -1) {
fprintf(stderr, "[samfaipath] fail to read file %s.\n", fn_ref);
} else {
fn_list = calloc(strlen(fn_ref) + 5, 1);
strcat(strcpy(fn_list, fn_ref), ".fai");
if (access(fn_list, R_OK) == -1) { // fn_list is unreadable
if (access(fn_ref, R_OK) == -1) {
fprintf(stderr, "[samfaipath] fail to read file %s.\n", fn_ref);
} else {