diff options
author | Kamil Zbróg | 2013-11-14 20:27:00 +0000 |
---|---|---|
committer | Kamil Zbróg | 2013-11-14 20:27:00 +0000 |
commit | e8f15766f8bdd1825d38faaef821d267a2f58f18 (patch) | |
tree | 2c37cc2c16fa06872619c28bb252f41ba27e448c /backends/platform/sdl/posix | |
parent | 7b1fed7331df8e4f4071445626d1ca67a5e7ff7b (diff) | |
parent | 8b9d4348f8e590de5693f6dd2ea0df0f5a4e445a (diff) | |
download | scummvm-rg350-e8f15766f8bdd1825d38faaef821d267a2f58f18.tar.gz scummvm-rg350-e8f15766f8bdd1825d38faaef821d267a2f58f18.tar.bz2 scummvm-rg350-e8f15766f8bdd1825d38faaef821d267a2f58f18.zip |
Merge remote-tracking branch 'sync/master' into prince-malik
Diffstat (limited to 'backends/platform/sdl/posix')
-rw-r--r-- | backends/platform/sdl/posix/posix.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp index 7a8b1e7b70..954f404ac6 100644 --- a/backends/platform/sdl/posix/posix.cpp +++ b/backends/platform/sdl/posix/posix.cpp @@ -80,15 +80,16 @@ bool OSystem_POSIX::hasFeature(Feature f) { } Common::String OSystem_POSIX::getDefaultConfigFileName() { - char configFile[MAXPATHLEN]; + Common::String configFile; // On POSIX type systems, by default we store the config file inside // to the HOME directory of the user. const char *home = getenv("HOME"); - if (home != NULL && strlen(home) < MAXPATHLEN) - snprintf(configFile, MAXPATHLEN, "%s/%s", home, _baseConfigName.c_str()); - else - strcpy(configFile, _baseConfigName.c_str()); + if (home != NULL && (strlen(home) + 1 + _baseConfigName.size()) < MAXPATHLEN) { + configFile = Common::String::format("%s/%s", home, _baseConfigName.c_str()); + } else { + configFile = _baseConfigName; + } return configFile; } |