aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2003-05-19 19:19:32 +0000
committerMax Horn2003-05-19 19:19:32 +0000
commitd6cf47dfaacedaaea15dd019ce2c826c0720e942 (patch)
tree3898add4927adb851d52e582fa08ef657d28c1b4 /common
parenta8627b1da6001ba7182439de098ffab8e08e845c (diff)
downloadscummvm-rg350-d6cf47dfaacedaaea15dd019ce2c826c0720e942.tar.gz
scummvm-rg350-d6cf47dfaacedaaea15dd019ce2c826c0720e942.tar.bz2
scummvm-rg350-d6cf47dfaacedaaea15dd019ce2c826c0720e942.zip
Patch #739911: Fix for undefined behaviour in fopenNoCase()
svn-id: r7695
Diffstat (limited to 'common')
-rw-r--r--common/file.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/file.cpp b/common/file.cpp
index ff666e820a..7168c74f82 100644
--- a/common/file.cpp
+++ b/common/file.cpp
@@ -71,16 +71,16 @@ FILE *File::fopenNoCase(const char *filename, const char *directory, const char
ptr = buf + len;
do
- *ptr++ = toupper(*ptr);
- while (*ptr);
+ *ptr = toupper(*ptr);
+ while (*ptr++);
file = fopen(buf, mode);
if (file)
return file;
ptr = buf + len;
do
- *ptr++ = tolower(*ptr);
- while (*ptr);
+ *ptr = tolower(*ptr);
+ while (*ptr++);
file = fopen(buf, mode);
if (file)
return file;