aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/access/font.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/access/font.cpp b/engines/access/font.cpp
index 75add4129c..ffc1715c39 100644
--- a/engines/access/font.cpp
+++ b/engines/access/font.cpp
@@ -74,6 +74,9 @@ void Font::load(const int *fontIndex, const byte *fontData) {
}
int Font::charWidth(char c) {
+ if (c < ' ')
+ return 0;
+
return _chars[c - ' '].w;
}
@@ -95,7 +98,7 @@ bool Font::getLine(Common::String &s, int maxWidth, Common::String &line, int &w
while ((c = *src) != '\0') {
if (c == '\r') {
// End of line, so return calculated line
- line = Common::String(s.c_str(), src - 1);
+ line = Common::String(s.c_str(), src);
s = Common::String(src + 1);
return false;
}