summaryrefslogtreecommitdiff
path: root/src/i_sdlsound.c
diff options
context:
space:
mode:
authorSimon Howard2014-03-30 18:07:52 -0400
committerSimon Howard2014-03-30 18:09:07 -0400
commit71d8ef248f4f1a05646f5e1e7e6388a59f08b121 (patch)
tree27aa543016b37eec74e99b49d309f235f6ecdc29 /src/i_sdlsound.c
parent724c4ad7a4f2a541eff157d9196b3835eb4bc8d8 (diff)
downloadchocolate-doom-71d8ef248f4f1a05646f5e1e7e6388a59f08b121.tar.gz
chocolate-doom-71d8ef248f4f1a05646f5e1e7e6388a59f08b121.tar.bz2
chocolate-doom-71d8ef248f4f1a05646f5e1e7e6388a59f08b121.zip
Eliminate some uses of sprintf() from common code.
As part of this, add DIR_SEPARATOR_S as a string version of the DIR_SEPARATOR macro. Change M_TempFile() to return a string allocated on the C heap rather than the zone heap. This is a first step towards fixing #371.
Diffstat (limited to 'src/i_sdlsound.c')
-rw-r--r--src/i_sdlsound.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/i_sdlsound.c b/src/i_sdlsound.c
index b35c83ea..70c360aa 100644
--- a/src/i_sdlsound.c
+++ b/src/i_sdlsound.c
@@ -705,7 +705,8 @@ static boolean CacheSFX(sfxinfo_t *sfxinfo)
{
char filename[16];
- sprintf(filename, "%s.wav", DEH_String(S_sfx[sound].name));
+ snprintf(filename, sizeof(filename), "%s.wav",
+ DEH_String(S_sfx[sound].name));
WriteWAV(filename, sound_chunks[sound].abuf,
sound_chunks[sound].alen, mixer_freq);
}