[Scummvm-cvs-logs] SF.net SVN: scummvm: [24761] scummvm/trunk/engines/agi/predictive.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Wed Nov 22 19:25:16 CET 2006


Revision: 24761
          http://svn.sourceforge.net/scummvm/?rev=24761&view=rev
Author:   eriktorbjorn
Date:     2006-11-22 10:25:16 -0800 (Wed, 22 Nov 2006)

Log Message:
-----------
Don't crash in loadDict() if pred.txt is missing.

Modified Paths:
--------------
    scummvm/trunk/engines/agi/predictive.cpp

Modified: scummvm/trunk/engines/agi/predictive.cpp
===================================================================
--- scummvm/trunk/engines/agi/predictive.cpp	2006-11-22 15:50:30 UTC (rev 24760)
+++ scummvm/trunk/engines/agi/predictive.cpp	2006-11-22 18:25:16 UTC (rev 24761)
@@ -63,8 +63,11 @@
 	};
 	const char *modes[] = { "Pre", "123", "Abc" };
 
-	if (!_dict.size())
+	if (!_dict.size()) {
 		loadDict();
+		if (!_dict.size())
+			return false;
+	}
 
 	draw_window(50, 40, 269, 159);
 	draw_rectangle(62, 54, 249, 66, MSG_BOX_TEXT);
@@ -267,7 +270,8 @@
 	Common::File in;
 	char buf[MAXLINELEN];
 
-	in.open("pred.txt");
+	if (!in.open("pred.txt"))
+		return;
 
 	while (!in.eos()) {
 		if (!in.readLine(buf, MAXLINELEN))


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