From 3c2a409b11e727c0e990de12a67a5a9c0deb85c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Ko=C5=82odziejski?= Date: Tue, 22 Oct 2002 20:40:51 +0000 Subject: [PATCH] cleanup array svn-id: r5250 --- common/file.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/common/file.cpp b/common/file.cpp index bc95d4a212d..665466beeaf 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -41,14 +41,14 @@ FILE *File::fopenNoCase(const char *filename, const char * directory, const char if (file) return file; - char dirs[7][10]; - dirs[0][0] = 0; - strcpy(dirs[1], "video/"); - strcpy(dirs[2], "VIDEO/"); - strcpy(dirs[3], "data/"); - strcpy(dirs[4], "DATA/"); - strcpy(dirs[5], "resource/"); - strcpy(dirs[6], "RESOURCE/"); + struct t_dirs { + char dir[20]; + } dirs[] = { + "", + "video/", "VIDEO/", + "data/", "DATA/", + "resource/", "RESOURCE/" + }; for (uint8 l = 0; l < 7; l++) { strcpy(buf, directory); @@ -59,7 +59,7 @@ FILE *File::fopenNoCase(const char *filename, const char * directory, const char #endif strcat(buf, "/"); } - strcat(buf, dirs[l]); + strcat(buf, dirs[l].dir); int8 len = strlen(buf); strcat(buf, filename);