From d6cf47dfaacedaaea15dd019ce2c826c0720e942 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 19 May 2003 19:19:32 +0000 Subject: Patch #739911: Fix for undefined behaviour in fopenNoCase() svn-id: r7695 --- common/file.cpp | 8 ++++---- 1 file 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; -- cgit v1.2.3