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
This commit is contained in:
tbeu
2017-11-03 21:09:44 +01:00
committed by Dan Čermák
parent 12d0da619b
commit bb9034e029
+2 -2
View File
@@ -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;
}