[Scummvm-cvs-logs] SF.net SVN: scummvm: [23568] scummvm/trunk/common/md5.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sat Jul 22 19:06:18 CEST 2006


Revision: 23568
Author:   lordhoto
Date:     2006-07-22 10:06:14 -0700 (Sat, 22 Jul 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23568&view=rev

Log Message:
-----------
Added some warnings if md5_file is used on an illegal FilesystemNode.

Modified Paths:
--------------
    scummvm/trunk/common/md5.cpp
Modified: scummvm/trunk/common/md5.cpp
===================================================================
--- scummvm/trunk/common/md5.cpp	2006-07-22 17:01:50 UTC (rev 23567)
+++ scummvm/trunk/common/md5.cpp	2006-07-22 17:06:14 UTC (rev 23568)
@@ -234,8 +234,13 @@
 }
 
 bool md5_file(const FilesystemNode &file, uint8 digest[16], uint32 length) {
-	if (file.isDirectory())
+	if (!file.isValid()) {
+		warning("md5_file: using an invalid FilesystemNode");
 		return false;
+	} else if (file.isDirectory()) {
+		warning("md5_file: using a diretory FilesystemNode");
+		return false;
+	}
 
 	return md5_file(file.path().c_str(), digest, length);
 }


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