Skip to content

Commit

Permalink
SHERLOCK: RT: Fix char tests to be unsigned in splitLines
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jun 20, 2015
1 parent beedcaf commit c3621a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions engines/sherlock/tattoo/widget_base.cpp
Expand Up @@ -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
Expand All @@ -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();
Expand Down

0 comments on commit c3621a0

Please sign in to comment.