This piece of code is resulting in a sementation fault

because I have some values in my exp file that are bad

(from vector_clip?) Seem's like there could be some

better validation of the values:

if (exp_Nentries(si->e, EFLT_CL) &&

exp_Nentries(si->e, EFLT_CR)) {

int l = atoi(exp_get_entry(si->e, EFLT_CL));

int r = atoi(exp_get_entry(si->e, EFLT_CR));

for (; r >= l; r--) {

if (seq[r] != '*')

seq[r] = 'X';

}

}

I changed the above to the below code to get around the

segmentation fault and print out some informative

information:

if (exp_Nentries(si->e, EFLT_CL) &&

exp_Nentries(si->e, EFLT_CR)) {

int l = atoi(exp_get_entry(si->e, EFLT_CL));

int r = atoi(exp_get_entry(si->e, EFLT_CR));

if ((r >= 0 && r < seq_length) && (l >= 0 && l <

0)) {

for (; r >= l; r--) {

if (seq[r] != '*')

seq[r] = 'X';

}

} else {

printf("WARNING cannot X out vector

sequence!!\nCL (%d) and CR (%d) values not within

sequence range 1 - %d\n", l, r, seq_length);

}

}

cristyn@@broad.mit.edu "Cristyn Kells"