diff --git a/PowerEditor/src/ScitillaComponent/FunctionCallTip.cpp b/PowerEditor/src/ScitillaComponent/FunctionCallTip.cpp index 9252668ad..5f3c4934a 100644 --- a/PowerEditor/src/ScitillaComponent/FunctionCallTip.cpp +++ b/PowerEditor/src/ScitillaComponent/FunctionCallTip.cpp @@ -138,7 +138,7 @@ bool FunctionCallTip::getCursorFunction() int endpos = _pEditView->execute(SCI_GETLINEENDPOSITION, line); 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 - const int maxLen = 128; + const int maxLen = 256; if ((offset < 2) || (len >= maxLen)) { diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index beb41b6a9..c58647614 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -1865,7 +1865,7 @@ void ScintillaEditView::getLine(int lineNumber, TCHAR * line, int lineBufferLen) char *lineA = new char[lineBufferLen]; execute(SCI_GETLINE, lineNumber, (LPARAM)lineA); const TCHAR *lineW = wmc->char2wchar(lineA, cp); - lstrcpy(line, lineW); + lstrcpyn(line, lineW, lineBufferLen); delete [] lineA; } diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 6cd0df44a..04a2e11b3 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -1104,7 +1104,7 @@ BOOL CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) int selIndex = -1; generic_string str; EncodingMapper *em = EncodingMapper::getInstance(); - for (int i = 0 ; i < sizeof(encodings)/sizeof(int) ; ++i) + for (size_t i = 0, encodingArraySize = sizeof(encodings)/sizeof(int) ; i < encodingArraySize ; ++i) { int cmdID = em->getIndexFromEncoding(encodings[i]); if (cmdID != -1)