From abd37177f2470caad29c57e63c249996417917c0 Mon Sep 17 00:00:00 2001 From: alberth Date: Sun, 5 Jul 2009 15:01:36 +0000 Subject: (svn r16748) -Codechange: Don't cast away constness. --- src/fios.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/fios.cpp') diff --git a/src/fios.cpp b/src/fios.cpp index dfa57ccf2..56048197f 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -572,13 +572,15 @@ public: Md5 checksum; uint8 buffer[1024]; + char basename[MAX_PATH]; ///< \a filename without the extension. size_t len, size; /* open the scenario file, but first get the name. * This is safe as we check on extension which * must always exist. */ - *(char *)strrchr(filename, '.') = '\0'; - f = FioFOpenFile(filename, "rb", SCENARIO_DIR, &size); + strecpy(basename, filename, lastof(basename)); + *strrchr(basename, '.') = '\0'; + f = FioFOpenFile(basename, "rb", SCENARIO_DIR, &size); if (f == NULL) return false; /* calculate md5sum */ -- cgit v1.2.3-54-g00ecf