aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2015-06-20 14:42:10 -0400
committerPaul Gilbert2015-06-20 14:42:10 -0400
commitc3621a0b0ca5b4e755f4d8263a325f8210be22a5 (patch)
tree826f6d7899a4d596f191ee04e95c0fdeeb7939d1 /engines
parentbeedcaf28ee83411d75fb159703823ab1ebe7925 (diff)
downloadscummvm-rg350-c3621a0b0ca5b4e755f4d8263a325f8210be22a5.tar.gz
scummvm-rg350-c3621a0b0ca5b4e755f4d8263a325f8210be22a5.tar.bz2
scummvm-rg350-c3621a0b0ca5b4e755f4d8263a325f8210be22a5.zip
SHERLOCK: RT: Fix char tests to be unsigned in splitLines
Diffstat (limited to 'engines')
-rw-r--r--engines/sherlock/tattoo/widget_base.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/sherlock/tattoo/widget_base.cpp b/engines/sherlock/tattoo/widget_base.cpp
index 2294961ca7..0fddb2759c 100644
--- a/engines/sherlock/tattoo/widget_base.cpp
+++ b/engines/sherlock/tattoo/widget_base.cpp
@@ -56,7 +56,8 @@ Common::String WidgetBase::splitLines(const Common::String &str, Common::StringA
const char *lineStartP = strP;
// Find how many characters will fit on the next line
- while (width < maxWidth && *strP && (*strP < 170 || *strP == talk._opcodes[OP_NULL])) {
+ while (width < maxWidth && *strP && ((byte)*strP < talk._opcodes[OP_SWITCH_SPEAKER] ||
+ (byte)*strP == talk._opcodes[OP_NULL])) {
width += _surface.charWidth(*strP);
// Keep track of the last space
@@ -76,7 +77,7 @@ Common::String WidgetBase::splitLines(const Common::String &str, Common::StringA
// Move the string ahead to the next line
if (*strP == ' ' || *strP == 13)
++strP;
- } while (*strP && (*strP < talk._opcodes[OP_SWITCH_SPEAKER] || *strP == talk._opcodes[OP_NULL]));
+ } while (*strP && ((byte)*strP < talk._opcodes[OP_SWITCH_SPEAKER] || (byte)*strP == talk._opcodes[OP_NULL]));
// Return any remaining text left over
return *strP ? Common::String(strP) : Common::String();