AGI: Resolved an old FIXME concerning OOB access

This commit is contained in:
Filippos Karapetis 2011-09-25 18:35:37 +03:00
parent a1c4aa6d89
commit 18a0214672

View File

@ -89,8 +89,7 @@ void AgiEngine::printText2(int l, const char *msg, int foff, int xoff, int yoff,
x1++;
// DF: changed the len-1 to len...
// FIXME: m[len] doesn't make sense and may read out of bounds?
if (x1 == len && m[len] != '\n') {
if (x1 == len && m[len - 1] != '\n') {
y1++;
x1 = foff = 0;
}
@ -732,4 +731,4 @@ void AgiEngine::drawWindow(int x1, int y1, int x2, int y2) {
_gfx->drawBox(x1, y1, x2, y2, MSG_BOX_COLOR, MSG_BOX_LINE, 2);
}
} // End of namespace Agi
} // End of namespace Agi