From bb9034e02916c30fe5b40f845a3904082d93c8f9 Mon Sep 17 00:00:00 2001 From: tbeu Date: Fri, 3 Nov 2017 21:09:44 +0100 Subject: [PATCH] Do not implicitly cast enum to Boolean V768 The expression 'fileProtocol(path)' is of enum type. It is odd that it is used as an expression of a Boolean-type. futils.cpp 288 --- src/futils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/futils.cpp b/src/futils.cpp index 0ea78113..54066998 100644 --- a/src/futils.cpp +++ b/src/futils.cpp @@ -291,7 +291,7 @@ namespace Exiv2 { bool fileExists(const std::string& path, bool ct) { // special case: accept "-" (means stdin) - if (path.compare("-") == 0 || fileProtocol(path)) { + if (path.compare("-") == 0 || fileProtocol(path) != pFile) { return true; } @@ -306,7 +306,7 @@ namespace Exiv2 { bool fileExists(const std::wstring& wpath, bool ct) { // special case: accept "-" (means stdin) - if (wpath.compare(L"-") == 0 || fileProtocol(wpath)) { + if (wpath.compare(L"-") == 0 || fileProtocol(wpath) != pFile) { return true; }