summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2014-08-17 18:21:33 -0400
committerSimon Howard2014-08-17 18:21:33 -0400
commit97f1de66497c1071ac138e0c63152267b9d2978f (patch)
tree766a50a3ac8b6e01c68738afb8b2e79e8b47818e /src
parentecd13198300a4ff01662a622cd33fb936da73559 (diff)
parent85221618cc9e56b4fa30af66d58031c2fb599088 (diff)
downloadchocolate-doom-97f1de66497c1071ac138e0c63152267b9d2978f.tar.gz
chocolate-doom-97f1de66497c1071ac138e0c63152267b9d2978f.tar.bz2
chocolate-doom-97f1de66497c1071ac138e0c63152267b9d2978f.zip
Merge branch 'master' of github.com:chocolate-doom/chocolate-doom
Diffstat (limited to 'src')
-rw-r--r--src/i_sdlsound.c2
-rw-r--r--src/strife/d_main.c27
2 files changed, 17 insertions, 12 deletions
diff --git a/src/i_sdlsound.c b/src/i_sdlsound.c
index 4c2ec5fa..7089378e 100644
--- a/src/i_sdlsound.c
+++ b/src/i_sdlsound.c
@@ -86,7 +86,7 @@ int use_libsamplerate = 0;
// of the time: with all the Doom IWAD sound effects, at least. If a PWAD
// is used, clipping might occur.
-float libsamplerate_scale = 0.65;
+float libsamplerate_scale = 0.65f;
// Hook a sound into the linked list at the head.
diff --git a/src/strife/d_main.c b/src/strife/d_main.c
index fdb6bbdc..b2eadd96 100644
--- a/src/strife/d_main.c
+++ b/src/strife/d_main.c
@@ -839,19 +839,24 @@ void D_IdentifyVersion(void)
if((p = M_CheckParm("-iwad")) && p < myargc - 1)
{
char *iwad = myargv[p + 1];
- size_t len = strlen(iwad) + 24;
- char *filename = malloc(len);
- char sepchar;
-
- // how the heck is Choco surviving without this routine?
- sepchar = M_GetFilePath(iwad, filename, len);
- filename[strlen(filename)] = sepchar;
- M_StringConcat(filename, "voices.wad", sizeof(filename));
-
- if(!M_FileExists(filename))
+ size_t len = strlen(iwad) + 1;
+ char *iwadpath = Z_Malloc(len, PU_STATIC, NULL);
+ char *voiceswad;
+
+ // extract base path of IWAD parameter
+ M_GetFilePath(iwad, iwadpath, len);
+
+ // concatenate with /voices.wad
+ voiceswad = M_SafeFilePath(iwadpath, "voices.wad");
+ Z_Free(iwadpath);
+
+ if(!M_FileExists(voiceswad))
+ {
disable_voices = 1;
+ Z_Free(voiceswad);
+ }
else
- name = filename; // STRIFE-FIXME: memory leak!!
+ name = voiceswad; // STRIFE-FIXME: memory leak!!
}
else
disable_voices = 1;