mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-25 14:54:39 +02:00
[BUG_FIXED] Fix function tip crash issue.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@420 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
9678cec404
commit
36ee1015ff
@ -116,11 +116,16 @@ bool FunctionCallTip::getCursorFunction() {
|
|||||||
int endpos = _pEditView->execute(SCI_GETLINEENDPOSITION, line);
|
int endpos = _pEditView->execute(SCI_GETLINEENDPOSITION, line);
|
||||||
int len = endpos - startpos + 3; //also take CRLF in account, even if not there
|
int len = endpos - startpos + 3; //also take CRLF in account, even if not there
|
||||||
int offset = _curPos - startpos; //offset is cursor location, only stuff before cursor has influence
|
int offset = _curPos - startpos; //offset is cursor location, only stuff before cursor has influence
|
||||||
if (offset < 2) {
|
const int maxLen = 128;
|
||||||
|
|
||||||
|
if ((offset < 2) || (len >= maxLen))
|
||||||
|
{
|
||||||
reset();
|
reset();
|
||||||
return false; //cannot be a func, need name and separator
|
return false; //cannot be a func, need name and separator
|
||||||
}
|
}
|
||||||
TCHAR * lineData = new TCHAR[len];
|
|
||||||
|
TCHAR lineData[maxLen] = TEXT("");
|
||||||
|
|
||||||
_pEditView->getLine(line, lineData, len);
|
_pEditView->getLine(line, lineData, len);
|
||||||
|
|
||||||
//line aquired, find the functionname
|
//line aquired, find the functionname
|
||||||
@ -227,7 +232,6 @@ bool FunctionCallTip::getCursorFunction() {
|
|||||||
res = true;
|
res = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete [] lineData;
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user