summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar lat9nq2022-05-26 18:49:18 -0400
committerGravatar lat9nq2022-05-26 19:01:26 -0400
commit0e5a6676c325b2183904643a42ce7593b36e0d8c (patch)
treeb3bf6795af3bc9d7c7855c1307932cdb7bf1dcba
parentMerge pull request #8379 from lat9nq/amd-push-desc-workaround (diff)
downloadyuzu-0e5a6676c325b2183904643a42ce7593b36e0d8c.tar.gz
yuzu-0e5a6676c325b2183904643a42ce7593b36e0d8c.tar.xz
yuzu-0e5a6676c325b2183904643a42ce7593b36e0d8c.zip
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 <mathew1800@gmail.com>
-rw-r--r--src/common/fs/path_util.cpp4
1 files changed, 1 insertions, 3 deletions
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) {
232fs::path GetExeDirectory() { 232fs::path GetExeDirectory() {
233 wchar_t exe_path[MAX_PATH]; 233 wchar_t exe_path[MAX_PATH];
234 234
235 GetModuleFileNameW(nullptr, exe_path, MAX_PATH); 235 if (GetModuleFileNameW(nullptr, exe_path, MAX_PATH) == 0) {
236
237 if (!exe_path) {
238 LOG_ERROR(Common_Filesystem, 236 LOG_ERROR(Common_Filesystem,
239 "Failed to get the path to the executable of the current process"); 237 "Failed to get the path to the executable of the current process");
240 } 238 }