diff options
Diffstat (limited to 'common/md5.cpp')
-rw-r--r-- | common/md5.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/common/md5.cpp b/common/md5.cpp index 35fbe0b9ab..32acdc5b8c 100644 --- a/common/md5.cpp +++ b/common/md5.cpp @@ -246,11 +246,14 @@ void md5_finish(md5_context *ctx, uint8 digest[16]) { } bool md5_file(const FilesystemNode &file, uint8 digest[16], uint32 length) { - if (!file.isValid()) { - warning("md5_file: using an invalid FilesystemNode"); + if(!file.exists()) { + warning("md5_file: using an inexistent FilesystemNode"); + return false; + } else if (!file.isReadable()) { + warning("md5_file: using an unreadable FilesystemNode"); return false; } else if (file.isDirectory()) { - warning("md5_file: using a diretory FilesystemNode"); + warning("md5_file: using a directory FilesystemNode"); return false; } |