summaryrefslogtreecommitdiffstats
path: root/src/audio
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-07-26 19:59:58 +0200
committereray orçunus <erayorcunus@gmail.com>2020-07-28 16:56:47 +0200
commitc87b639a84ca8bc33667abc98a731a61350cc518 (patch)
tree5805f0a7f60da9ba4acd0e60700f0418c1f01188 /src/audio
parentMerge pull request #665 from erorcun/miami (diff)
downloadre3-c87b639a84ca8bc33667abc98a731a61350cc518.tar
re3-c87b639a84ca8bc33667abc98a731a61350cc518.tar.gz
re3-c87b639a84ca8bc33667abc98a731a61350cc518.tar.bz2
re3-c87b639a84ca8bc33667abc98a731a61350cc518.tar.lz
re3-c87b639a84ca8bc33667abc98a731a61350cc518.tar.xz
re3-c87b639a84ca8bc33667abc98a731a61350cc518.tar.zst
re3-c87b639a84ca8bc33667abc98a731a61350cc518.zip
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/oal/stream.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp
index 40ec57fa..b689e929 100644
--- a/src/audio/oal/stream.cpp
+++ b/src/audio/oal/stream.cpp
@@ -255,15 +255,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) + 2);
- 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