diff options
| author | lat9nq <lat9nq@gmail.com> | 2022-05-26 18:49:18 -0400 |
|---|---|---|
| committer | lat9nq <lat9nq@gmail.com> | 2022-05-26 19:01:26 -0400 |
| commit | b73aaea0c1c983a23789917c357a414d6b873904 (patch) | |
| tree | b3bf6795af3bc9d7c7855c1307932cdb7bf1dcba /src/common | |
| parent | 6c88f50725599ed620a5d58e8e6c0285c0cf80c6 (diff) | |
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>
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/fs/path_util.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp index 62318e70cb..1074f24211 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"); } |
