Commit 488b0593 authored by Neil Kindlon's avatar Neil Kindlon
Browse files

Addressed bug #208; seg fault when VCF doesn't have SVLEN for imprecise variants.

parent 509e6fee
......@@ -140,7 +140,11 @@ bool SingleLineDelimTextFileReader::findDelimiters() {
int SingleLineDelimTextFileReader::getVcfSVlen() {
int startPos = _delimPositions[VCF_TAG_FIELD] +1;
const char *startPtr = strstr(_sLine.c_str() + startPos, "SVLEN=") +6;
const char *startPtr = strstr(_sLine.c_str() + startPos, "SVLEN=");
if (startPtr == NULL) {
cerr << "WARNING: line number " << _lineNum << " of file " << _filename << " has an imprecise variant, but no SVLEN specified. Defaulting to length 1." << endl;
return 1;
}
const char *endPtr = strchr(startPtr, ';');
const char *midPtr = strchr(startPtr, ',');
int endCoord = -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment