smarco / WFA2-lib

WFA-lib: Wavefront alignment algorithm library v2
Other
162 stars 36 forks source link

Bug in overloaded WFAligner::alignEndsFree() #11

Closed maxbbbb closed 2 years ago

maxbbbb commented 2 years ago

WFAligner::alignEndsFree() based on char* (line 106 in WFAligner.cpp) seems to be correct, but the other method based on std::string (line 122 in WFAligner.cpp) returns WFAligner::alignEnd2End(), which is not correct.

Instead, it is supposed to return WFAligner::alignEndsFree() using .c_str():

  return alignEndsFree(
      pattern.c_str(), pattern.length(), patternBeginFree, patternEndFree,
      text.c_str(), text.length(), textBeginFree, textEndFree);
smarco commented 2 years ago

Thanks for the report.

You are right! Solved in branch development (soon to be merged into main).