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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Sep 8 00:37:28 CEST 2008


Revision: 34437
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34437&view=rev
Author:   fingolfin
Date:     2008-09-07 22:37:27 +0000 (Sun, 07 Sep 2008)

Log Message:
-----------
Changed md5_file(FSNode) to use FSNode::openForReading

Modified Paths:
--------------
    scummvm/trunk/common/md5.cpp

Modified: scummvm/trunk/common/md5.cpp
===================================================================
--- scummvm/trunk/common/md5.cpp	2008-09-07 22:35:13 UTC (rev 34436)
+++ scummvm/trunk/common/md5.cpp	2008-09-07 22:37:27 UTC (rev 34437)
@@ -257,8 +257,16 @@
 		warning("md5_file: using a directory FilesystemNode");
 		return false;
 	}
+	
+	ReadStream *stream = file.openForReading();
+	if (!stream) {
+		warning("md5_file: failed to open '%s'", file.getPath().c_str());
+		return false;
+	}
 
-	return md5_file(file.getPath().c_str(), digest, length);
+	bool result =  md5_file(*stream, digest, length);
+	delete stream;
+	return result;
 }
 
 bool md5_file(const char *name, uint8 digest[16], uint32 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