aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorMax Horn2006-04-14 14:26:34 +0000
committerMax Horn2006-04-14 14:26:34 +0000
commitedd8557a0e9fbc4be48abe0579349642dc55d243 (patch)
treed2406903cf7ffc06c7e62343f73f65a0a9b6a07a /base
parent1eb526f71aa5967e010960842dd3f4b49a2e6324 (diff)
downloadscummvm-rg350-edd8557a0e9fbc4be48abe0579349642dc55d243.tar.gz
scummvm-rg350-edd8557a0e9fbc4be48abe0579349642dc55d243.tar.bz2
scummvm-rg350-edd8557a0e9fbc4be48abe0579349642dc55d243.zip
cleanup
svn-id: r21888
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;
}