From 0b26b99174366bd9eb12b7264b9bc2f9d3c72870 Mon Sep 17 00:00:00 2001 From: Glenn Hickey Date: Fri, 26 Jul 2013 14:19:25 -0700 Subject: [PATCH] fix bug in halAlignability and halPhyloPMain where more than the total length could be computed due to a bug in chopping into sequence coordinates --- alignability/halAlignability.cpp | 2 +- phyloP/impl/halPhyloPMain.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alignability/halAlignability.cpp b/alignability/halAlignability.cpp index ed664b76..bcd486b4 100644 --- a/alignability/halAlignability.cpp +++ b/alignability/halAlignability.cpp @@ -388,7 +388,7 @@ void printGenome(ostream& outStream, { hal_size_t readStart = seqStart >= start ? 0 : start - seqStart; hal_size_t readLen = min(seqLen - readStart, length); - + readLen = min(readLen, length - runningLength); printSequence(outStream, sequence, targetSet, readStart, readLen, step); runningLength += readLen; } diff --git a/phyloP/impl/halPhyloPMain.cpp b/phyloP/impl/halPhyloPMain.cpp index b693ca7e..bffe33d0 100644 --- a/phyloP/impl/halPhyloPMain.cpp +++ b/phyloP/impl/halPhyloPMain.cpp @@ -248,7 +248,7 @@ void printGenome(PhyloP *phyloP, { hal_size_t readStart = seqStart >= start ? 0 : start - seqStart; hal_size_t readLen = min(seqLen - readStart, length); - + readLen = min(readLen, length - runningLength); phyloP->processSequence(sequence, readStart, readLen, step); runningLength += readLen; }