[Scummvm-cvs-logs] SF.net SVN: scummvm:[38229] scummvm/trunk/engines/kyra/lol.cpp

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Sun Feb 15 13:11:30 CET 2009


Revision: 38229
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38229&view=rev
Author:   wjpalenstijn
Date:     2009-02-15 12:11:27 +0000 (Sun, 15 Feb 2009)

Log Message:
-----------
portability fix for platforms with unsigned char

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/lol.cpp

Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp	2009-02-15 11:44:14 UTC (rev 38228)
+++ scummvm/trunk/engines/kyra/lol.cpp	2009-02-15 12:11:27 UTC (rev 38229)
@@ -1203,9 +1203,10 @@
 		snprintf(pattern1, sizeof(pattern1), "@%04d", id - 1000);
 	}
 
-	for (char i = '0'; i != -1; i++) {
-		snprintf(file1, sizeof(file1), "%s%c%c.%s", pattern1, (char)speaker, i, pattern2);
-		snprintf(file2, sizeof(file2), "%s%c%c.%s", pattern1, '_', i, pattern2);
+	for (char i = 0; ; i++) {
+		char symbol = '0' + i;
+		snprintf(file1, sizeof(file1), "%s%c%c.%s", pattern1, (char)speaker, symbol, pattern2);
+		snprintf(file2, sizeof(file2), "%s%c%c.%s", pattern1, '_', symbol, pattern2);
 		if (_res->exists(file1)) {
 			char *f = new char[strlen(file1) + 1];
 			strcpy(f, file1);
@@ -1215,7 +1216,7 @@
 			strcpy(f, file2);
 			playList.push_back(f);
 		} else {
-			i = -2;
+			break;
 		}
 	}
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list