Skip to content

Commit

Permalink
Check for GetModuleFileName success
Browse files Browse the repository at this point in the history
  • Loading branch information
malensek committed Mar 25, 2015
1 parent ff37eac commit 312fa11
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions 3RVX/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ int Settings::Save() {
std::wstring Settings::AppDir() {
if (_appDir.empty()) {
wchar_t path[MAX_PATH] = { 0 };
GetModuleFileName(NULL, path, MAX_PATH);
PathRemoveFileSpec(path);
if (GetModuleFileName(NULL, path, MAX_PATH)) {
PathRemoveFileSpec(path);
}
_appDir = std::wstring(path);
}
return _appDir;
Expand Down

0 comments on commit 312fa11

Please sign in to comment.