SAGA2: Fix strlcpy range in document.cpp

This commit is contained in:
a/ 2021-08-13 22:50:26 +09:00
parent 81909e6dab
commit 0bdf49fb71
2 changed files with 4 additions and 4 deletions

View File

@ -258,7 +258,7 @@ bool CAutoMap::activate(gEventType why) {
bool CAutoMap::keyStroke(gPanelMessage &msg) {
gEvent ev;
switch (msg.key) {
case Common::ASCII_ESCAPE:
case Common::ASCII_ESCAPE:
cmdAutoMapEsc(ev);
return true;
case Common::KEYCODE_HOME:

View File

@ -162,13 +162,13 @@ CDocument::CDocument(CDocumentAppearance &dApp,
origText = new char[textSize + 1];
// and fill it
Common::strlcpy(origText, buffer, textSize);
Common::strlcpy(origText, buffer, textSize + 1);
// make a working buffer
text = new char[textSize + 1];
// and fill it
Common::strlcpy(text, origText, textSize);
Common::strlcpy(text, origText, textSize + 1);
textFont = font;
textHeight = (textFont ? textFont->height : 0);
@ -465,7 +465,7 @@ bool CDocument::checkForImage(char *string,
void CDocument::makePages(void) {
// copy the original text back to the working buffer
Common::strlcpy(text, origText, textSize);
Common::strlcpy(text, origText, textSize + 1);
char *str = text;