[Scummvm-cvs-logs] scummvm master -> c3621a0b0ca5b4e755f4d8263a325f8210be22a5

dreammaster dreammaster at scummvm.org
Sat Jun 20 20:43:11 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c3621a0b0c SHERLOCK: RT: Fix char tests to be unsigned in splitLines


Commit: c3621a0b0ca5b4e755f4d8263a325f8210be22a5
    https://github.com/scummvm/scummvm/commit/c3621a0b0ca5b4e755f4d8263a325f8210be22a5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-06-20T14:42:10-04:00

Commit Message:
SHERLOCK: RT: Fix char tests to be unsigned in splitLines

Changed paths:
    engines/sherlock/tattoo/widget_base.cpp



diff --git a/engines/sherlock/tattoo/widget_base.cpp b/engines/sherlock/tattoo/widget_base.cpp
index 2294961..0fddb27 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();






More information about the Scummvm-git-logs mailing list