1
0
Fork 0
forked from suyu/suyu

file_util: return string by const reference for GetExeDirectory()

This disallows modifying the internal string buffer (which shouldn't be
modified anyhow).
This commit is contained in:
Lioncash 2018-07-19 01:27:27 -04:00
parent 368e1d25be
commit 63e64f0131
2 changed files with 2 additions and 2 deletions

View file

@ -592,7 +592,7 @@ std::string GetBundleDirectory() {
#endif
#ifdef _WIN32
std::string& GetExeDirectory() {
const std::string& GetExeDirectory() {
static std::string exe_path;
if (exe_path.empty()) {
wchar_t wchar_exe_path[2048];

View file

@ -133,7 +133,7 @@ std::string GetBundleDirectory();
#endif
#ifdef _WIN32
std::string& GetExeDirectory();
const std::string& GetExeDirectory();
std::string AppDataRoamingDirectory();
#endif