Skip to content
Snippets Groups Projects
Commit 0e5a6676 authored by lat9nq's avatar lat9nq
Browse files

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: default avatarMai M <mathew1800@gmail.com>
parent a9beb474
No related branches found
No related tags found
No related merge requests found
...@@ -232,9 +232,7 @@ void SetYuzuPath(YuzuPath yuzu_path, const fs::path& new_path) { ...@@ -232,9 +232,7 @@ void SetYuzuPath(YuzuPath yuzu_path, const fs::path& new_path) {
fs::path GetExeDirectory() { fs::path GetExeDirectory() {
wchar_t exe_path[MAX_PATH]; wchar_t exe_path[MAX_PATH];
GetModuleFileNameW(nullptr, exe_path, MAX_PATH); if (GetModuleFileNameW(nullptr, exe_path, MAX_PATH) == 0) {
if (!exe_path) {
LOG_ERROR(Common_Filesystem, LOG_ERROR(Common_Filesystem,
"Failed to get the path to the executable of the current process"); "Failed to get the path to the executable of the current process");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment