aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2002-10-22 23:36:54 +0000
committerMax Horn2002-10-22 23:36:54 +0000
commit6e5ff6884fb422ce0a9dca3a5347ca114c3f0cd9 (patch)
treee692da9a824e9460e11fb39c70201ab3e4b78f89
parent64195315e28dd0b9c20445c918f6ea4c342522ad (diff)
downloadscummvm-rg350-6e5ff6884fb422ce0a9dca3a5347ca114c3f0cd9.tar.gz
scummvm-rg350-6e5ff6884fb422ce0a9dca3a5347ca114c3f0cd9.tar.bz2
scummvm-rg350-6e5ff6884fb422ce0a9dca3a5347ca114c3f0cd9.zip
fixed warnings (and simplified the code, gosh, aquadran, why so complicated? :-)
svn-id: r5264
-rw-r--r--common/file.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/common/file.cpp b/common/file.cpp
index 665466beea..7fa6ec39f7 100644
--- a/common/file.cpp
+++ b/common/file.cpp
@@ -29,7 +29,6 @@ FILE *File::fopenNoCase(const char *filename, const char * directory, const char
strcpy(buf, directory);
if (directory[0] != 0) {
- strcpy(buf, directory);
#ifdef __MORPHOS__
if (buf[strlen(buf)-1] != ':' && buf[strlen(buf)-1] != '/')
#endif
@@ -41,25 +40,25 @@ FILE *File::fopenNoCase(const char *filename, const char * directory, const char
if (file)
return file;
- struct t_dirs {
- char dir[20];
- } dirs[] = {
+ const char *dirs[] = {
"",
- "video/", "VIDEO/",
- "data/", "DATA/",
- "resource/", "RESOURCE/"
+ "video/",
+ "VIDEO/",
+ "data/",
+ "DATA/",
+ "resource/",
+ "RESOURCE/"
};
for (uint8 l = 0; l < 7; l++) {
strcpy(buf, directory);
if (directory[0] != 0) {
- strcpy(buf, directory);
#ifdef __MORPHOS__
if (buf[strlen(buf)-1] != ':' && buf[strlen(buf)-1] != '/')
#endif
strcat(buf, "/");
}
- strcat(buf, dirs[l].dir);
+ strcat(buf, dirs[l]);
int8 len = strlen(buf);
strcat(buf, filename);