Commit 483875f2 authored by Erik Verbruggen's avatar Erik Verbruggen

Fixed an off-by-one array-out-of-bounds bug.

Reviewed-by: Lasse Holmstedt
parent 752606e4
......@@ -169,10 +169,10 @@ void FindUsages::reportResult(unsigned tokenIndex)
getTokenStartPosition(tokenIndex, &line, &col);
QString lineText;
QList<QByteArray> lines = _originalSource.split('\n');
if (lines.size() < ((int) line - 1))
lineText = matchingLine(tk);
else
if (((int) line - 1) < lines.size())
lineText = QString::fromUtf8(lines.at(line - 1));
else
lineText = matchingLine(tk);
if (col)
--col; // adjust the column position.
......
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