aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2004-12-05 23:24:43 +0000
committerMax Horn2004-12-05 23:24:43 +0000
commit30039560a39d306db43592e1dd59bc4ec9fadecf (patch)
tree1595608398cbaea1e32ecfb78e1147cfdead6e14
parentf09293b22cdec7d8b309baea0a58e93757c77913 (diff)
downloadscummvm-rg350-30039560a39d306db43592e1dd59bc4ec9fadecf.tar.gz
scummvm-rg350-30039560a39d306db43592e1dd59bc4ec9fadecf.tar.bz2
scummvm-rg350-30039560a39d306db43592e1dd59bc4ec9fadecf.zip
cleanup
svn-id: r15991
-rw-r--r--common/config-manager.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index fcc660daa4..81e8ed15e2 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -26,9 +26,6 @@
#if defined(UNIX)
#include <sys/param.h>
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 256
-#endif
#ifdef MACOSX
#define DEFAULT_CONFIG_FILE "Library/Preferences/ScummVM Preferences"
#else
@@ -38,6 +35,10 @@
#define DEFAULT_CONFIG_FILE "scummvm.ini"
#endif
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 256
+#endif
+
#define MAXLINELEN 256
static char *ltrim(char *t) {
@@ -67,20 +68,18 @@ const String falseStr("false");
ConfigManager::ConfigManager() {
-#if defined(UNIX)
char configFile[MAXPATHLEN];
+#if defined(UNIX)
if(getenv("HOME") != NULL)
sprintf(configFile,"%s/%s", getenv("HOME"), DEFAULT_CONFIG_FILE);
- else strcpy(configFile,DEFAULT_CONFIG_FILE);
+ else
+ strcpy(configFile, DEFAULT_CONFIG_FILE);
#else
- char configFile[256];
#if defined (WIN32) && !defined(_WIN32_WCE)
- GetWindowsDirectory(configFile, 256);
- strcat(configFile, "\\");
- strcat(configFile, DEFAULT_CONFIG_FILE);
+ GetWindowsDirectory(configFile, MAXPATHLEN);
+ strcat(configFile, "\\" DEFAULT_CONFIG_FILE);
#elif defined(__PALM_OS__)
- strcpy(configFile,"/PALM/Programs/ScummVM/");
- strcat(configFile, DEFAULT_CONFIG_FILE);
+ strcpy(configFile,"/PALM/Programs/ScummVM/" DEFAULT_CONFIG_FILE);
#else
strcpy(configFile, DEFAULT_CONFIG_FILE);
#endif