From 1ffd49604357ed6fd63e133369a89e3b57711ae2 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 22 Jul 2006 17:06:14 +0000 Subject: Added some warnings if md5_file is used on an illegal FilesystemNode. svn-id: r23568 --- common/md5.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/md5.cpp b/common/md5.cpp index 11bc5d6487..287e14107a 100644 --- a/common/md5.cpp +++ b/common/md5.cpp @@ -234,8 +234,13 @@ void md5_finish(md5_context *ctx, uint8 digest[16]) { } 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); } -- cgit v1.2.3