aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
diff options
context:
space:
mode:
authorFilippos Karapetis2011-09-25 18:35:37 +0300
committerFilippos Karapetis2011-09-25 18:35:37 +0300
commit18a0214672c34411bbbff6be383425f7a4c38544 (patch)
tree5d135cbfc85c146104729ceec84dfe4563c041bc /engines/agi
parenta1c4aa6d89805a0d9929f3d746f88f8cd15930ab (diff)
downloadscummvm-rg350-18a0214672c34411bbbff6be383425f7a4c38544.tar.gz
scummvm-rg350-18a0214672c34411bbbff6be383425f7a4c38544.tar.bz2
scummvm-rg350-18a0214672c34411bbbff6be383425f7a4c38544.zip
AGI: Resolved an old FIXME concerning OOB access
Diffstat (limited to 'engines/agi')
-rw-r--r--engines/agi/text.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp
index 82a2340ad6..efb4a640c6 100644
--- a/engines/agi/text.cpp
+++ b/engines/agi/text.cpp
@@ -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 \ No newline at end of file