diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-07-26 19:59:58 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-07-28 16:40:12 +0200 |
commit | eb8844fd113d3fdae0456d56bdb0eb56e3a5f26b (patch) | |
tree | 127e6f19fa16061661ac1eed9158caece6dd4521 /src/audio | |
parent | Provide more memory for casepath's arg (diff) | |
download | re3-eb8844fd113d3fdae0456d56bdb0eb56e3a5f26b.tar re3-eb8844fd113d3fdae0456d56bdb0eb56e3a5f26b.tar.gz re3-eb8844fd113d3fdae0456d56bdb0eb56e3a5f26b.tar.bz2 re3-eb8844fd113d3fdae0456d56bdb0eb56e3a5f26b.tar.lz re3-eb8844fd113d3fdae0456d56bdb0eb56e3a5f26b.tar.xz re3-eb8844fd113d3fdae0456d56bdb0eb56e3a5f26b.tar.zst re3-eb8844fd113d3fdae0456d56bdb0eb56e3a5f26b.zip |
Diffstat (limited to 'src/audio')
-rw-r--r-- | src/audio/oal/stream.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp index 1ffe941e..9fad47a9 100644 --- a/src/audio/oal/stream.cpp +++ b/src/audio/oal/stream.cpp @@ -203,15 +203,11 @@ CStream::CStream(char *filename, ALuint &source, ALuint (&buffers)[NUM_STREAMBUF { // Be case-insensitive on linux (from https://github.com/OneSadCookie/fcaseopen/) #if !defined(_WIN32) - FILE *test = fopen(filename, "r"); - if (!test) { - char *r = (char*)alloca(strlen(filename) + 4); - if (casepath(filename, r)) - { - strcpy(m_aFilename, r); - } + char *real = casepath(filename); + if (real) { + strcpy(m_aFilename, real); + free(real); } else { - fclose(test); #else { #endif |