diff options
author | Max Horn | 2008-09-07 22:37:27 +0000 |
---|---|---|
committer | Max Horn | 2008-09-07 22:37:27 +0000 |
commit | d0ffcd6772aa5e1b329f849395873052d1194b13 (patch) | |
tree | fa36dd6c8a20bac2048b84a1eb18e43653b3c1da /common | |
parent | 06d57a54f3b2ec623c085d0bcce76df4e3acd50d (diff) | |
download | scummvm-rg350-d0ffcd6772aa5e1b329f849395873052d1194b13.tar.gz scummvm-rg350-d0ffcd6772aa5e1b329f849395873052d1194b13.tar.bz2 scummvm-rg350-d0ffcd6772aa5e1b329f849395873052d1194b13.zip |
Changed md5_file(FSNode) to use FSNode::openForReading
svn-id: r34437
Diffstat (limited to 'common')
-rw-r--r-- | common/md5.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/common/md5.cpp b/common/md5.cpp index 7bbb941194..4eeb3d9a39 100644 --- a/common/md5.cpp +++ b/common/md5.cpp @@ -257,8 +257,16 @@ bool md5_file(const FilesystemNode &file, uint8 digest[16], uint32 length) { 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) { |