From 0e5a6676c325b2183904643a42ce7593b36e0d8c Mon Sep 17 00:00:00 2001 From: lat9nq Date: Thu, 26 May 2022 18:49:18 -0400 Subject: path_util: Resolve `-Wpointer-bool-conversion` warning Clang (rightfully) warns that we are checking for the existence of pointer to something just allocated on the stack, which is always true. Instead, check whether GetModuleFileNameW failed. Co-authored-by: Mai M --- src/common/fs/path_util.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/common/fs/path_util.cpp') diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp index 62318e70c..1074f2421 100644 --- a/src/common/fs/path_util.cpp +++ b/src/common/fs/path_util.cpp @@ -232,9 +232,7 @@ void SetYuzuPath(YuzuPath yuzu_path, const fs::path& new_path) { fs::path GetExeDirectory() { wchar_t exe_path[MAX_PATH]; - GetModuleFileNameW(nullptr, exe_path, MAX_PATH); - - if (!exe_path) { + if (GetModuleFileNameW(nullptr, exe_path, MAX_PATH) == 0) { LOG_ERROR(Common_Filesystem, "Failed to get the path to the executable of the current process"); } -- cgit v1.2.3