diff options
author | Thilo Schulz <arny@ats.s.bawue.de> | 2011-05-12 10:53:36 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-09 22:09:29 +0000 |
commit | ae264a8192d609e6e24c7e7a65214ac676b92300 (patch) | |
tree | f5a95dbf6175ffe93c54d0121795b559a2abd629 | |
parent | d0dc3c62a60a339f4669ee5d59d0a08c2a7c0022 (diff) |
Fix crash bug in new codec audio loader, thanks brain for reporting
-rw-r--r-- | src/client/snd_codec.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/src/client/snd_codec.c b/src/client/snd_codec.c index f3c5dda9..61403148 100644 --- a/src/client/snd_codec.c +++ b/src/client/snd_codec.c @@ -29,31 +29,6 @@ static snd_codec_t *codecs; /* ================= -S_FileExtension -================= -*/ -static char *S_FileExtension(const char *fni) -{ - // we should search from the ending to the last '/' - - char *fn = (char *) fni + strlen(fni) - 1; - char *eptr = NULL; - - while(*fn != '/' && fn != fni) - { - if(*fn == '.') - { - eptr = fn; - break; - } - fn--; - } - - return eptr; -} - -/* -================= S_CodecGetSound Opens/loads a sound, tries codec based on the sound's file extension @@ -72,7 +47,7 @@ static void *S_CodecGetSound(const char *filename, snd_info_t *info) Q_strncpyz(localName, filename, MAX_QPATH); - ext = S_FileExtension(localName); + ext = COM_GetExtension(localName); if( *ext ) { |