ui: fixed crash when clicking on namespace label

This commit is contained in:
Eberhard Graether
2018-05-04 16:09:43 +02:00
parent bf2b56a69e
commit 568e2f3e36
6 changed files with 21 additions and 16 deletions
+3 -2
View File
@@ -80,8 +80,9 @@ std::vector<int> SuffixArray::searchForTerm(const std::wstring& searchTerm) cons
std::transform(term.begin(), term.end(), term.begin(), ::tolower);
int termLength = term.length();
int textLength = m_text.length();
int l = -1;
int r = m_text.length();
int r = textLength;
int m;
std::vector<int> matches;
@@ -105,7 +106,7 @@ std::vector<int> SuffixArray::searchForTerm(const std::wstring& searchTerm) cons
{
matches.push_back(m_array[lower]);
}
for (int higher = m+1; higher < m_text.length() && m_lcp[higher-1] >= termLength; higher++)
for (int higher = m+1; higher < textLength && m_lcp[higher-1] >= termLength; higher++)
{
matches.push_back(m_array[higher]);
}