Fix build error

This commit is contained in:
Don Ho 2022-01-16 14:07:26 +01:00
parent f20aa321db
commit 7a296a818d
2 changed files with 2 additions and 2 deletions

View File

@ -3609,7 +3609,7 @@ size_t Notepad_plus::getSelectedCharNumber(UniMode u)
} }
else else
{ {
for (int i=0; i < numSel; ++i) for (size_t i = 0; i < numSel; ++i)
{ {
size_t stpos = _pEditView->execute(SCI_GETSELECTIONNSTART, i); size_t stpos = _pEditView->execute(SCI_GETSELECTIONNSTART, i);
size_t endpos = _pEditView->execute(SCI_GETSELECTIONNEND, i); size_t endpos = _pEditView->execute(SCI_GETSELECTIONNEND, i);

View File

@ -2286,7 +2286,7 @@ char * ScintillaEditView::getSelectedText(char * txt, size_t size, bool expand)
expandWordSelection(); expandWordSelection();
range = getSelection(); range = getSelection();
} }
if (!(size > (range.cpMax - range.cpMin))) //there must be atleast 1 byte left for zero terminator if (!(static_cast<Sci_PositionCR>(size) > (range.cpMax - range.cpMin))) //there must be atleast 1 byte left for zero terminator
{ {
range.cpMax = range.cpMin + (Sci_PositionCR)size -1; //keep room for zero terminator range.cpMax = range.cpMin + (Sci_PositionCR)size -1; //keep room for zero terminator
} }