aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
Diffstat (limited to 'base')
-rw-r--r--base/engine.cpp2
-rw-r--r--base/gameDetector.cpp4
-rw-r--r--base/main.cpp4
3 files changed, 5 insertions, 5 deletions
diff --git a/base/engine.cpp b/base/engine.cpp
index 1d941df5bc..fb46949050 100644
--- a/base/engine.cpp
+++ b/base/engine.cpp
@@ -193,7 +193,7 @@ void NORETURN CDECL error(const char *s, ...) {
#ifdef __SYMBIAN32__
Symbian::FatalError(buf_output);
#endif
- // Finally exit. quit() will terminate the program if g_system iss present
+ // Finally exit. quit() will terminate the program if g_system is present
if (g_system)
g_system->quit();
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp
index 857771784b..b21ccffb6b 100644
--- a/base/gameDetector.cpp
+++ b/base/gameDetector.cpp
@@ -214,7 +214,7 @@ GameDetector::GameDetector() {
#ifdef UNIX
struct stat sb;
const char *home = getenv("HOME");
- if (home != NULL && strlen(home) < MAXPATHLEN) {
+ if (home && *home && strlen(home) < MAXPATHLEN) {
snprintf(savePath, MAXPATHLEN, "%s/%s", home, DEFAULT_SAVE_PATH);
if (stat(savePath, &sb) == -1) {
/* create the dir if it does not exist */
@@ -559,7 +559,7 @@ void GameDetector::processSettings(Common::String &target, Common::StringMap &se
#if !defined(MACOS_CARBON) && !defined(_WIN32_WCE) && !defined(PALMOS_MODE) && !defined(__GP32__)
if (!settings.contains("savepath")) {
const char *dir = getenv("SCUMMVM_SAVEPATH");
- if (dir && *dir && strlen(dir) < 1024) {
+ if (dir && *dir && strlen(dir) < MAXPATHLEN) {
// TODO: Verify whether the path is valid
settings["savepath"] = dir;
}
diff --git a/base/main.cpp b/base/main.cpp
index d82b238b97..fabcce5b89 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -279,10 +279,10 @@ extern "C" int scummvm_main(int argc, char *argv[]) {
// inside parseCommandLine. This should be unified.
if (command == "list-targets") {
listTargets();
- exit(0);
+ return 0;
} else if (command == "list-games") {
listGames();
- exit(0);
+ return 0;
}