diff options
| author | 2018-07-19 01:27:27 -0400 | |
|---|---|---|
| committer | 2018-07-19 01:27:29 -0400 | |
| commit | 63e64f0131424708da5be6e64109f4909d65d057 (patch) | |
| tree | 763ffc8992522e3c725aea4536f9b7f861914b3f /src/common/file_util.cpp | |
| parent | Merge pull request #692 from lioncash/assign (diff) | |
| download | yuzu-63e64f0131424708da5be6e64109f4909d65d057.tar.gz yuzu-63e64f0131424708da5be6e64109f4909d65d057.tar.xz yuzu-63e64f0131424708da5be6e64109f4909d65d057.zip | |
file_util: return string by const reference for GetExeDirectory()
This disallows modifying the internal string buffer (which shouldn't be
modified anyhow).
Diffstat (limited to '')
| -rw-r--r-- | src/common/file_util.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index bf955386c..c882ab39f 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp | |||
| @@ -592,7 +592,7 @@ std::string GetBundleDirectory() { | |||
| 592 | #endif | 592 | #endif |
| 593 | 593 | ||
| 594 | #ifdef _WIN32 | 594 | #ifdef _WIN32 |
| 595 | std::string& GetExeDirectory() { | 595 | const std::string& GetExeDirectory() { |
| 596 | static std::string exe_path; | 596 | static std::string exe_path; |
| 597 | if (exe_path.empty()) { | 597 | if (exe_path.empty()) { |
| 598 | wchar_t wchar_exe_path[2048]; | 598 | wchar_t wchar_exe_path[2048]; |