Fixed non-null terminated string issue with music playlist

git-svn-id: https://openmw.svn.sourceforge.net/svnroot/openmw/trunk@18 ea6a568a-9f4f-0410-981a-c910a81bb256
actorid
nkorslund 17 years ago
parent da94867474
commit 31242e9940

@ -26,6 +26,8 @@ module sound.music;
import sound.audiere;
import sound.audio;
import std.string;
import core.config;
import core.resource;
@ -178,10 +180,7 @@ struct MusicManager
index = 0;
}
// Make sure the string is null terminated
assert(*(playlist[index].ptr+playlist[index].length) == 0);
music = cpp_playStream(playlist[index].ptr, volume);
music = cpp_playStream(toStringz(playlist[index]), volume);
if(!music) fail("Unable to start music track " ~ playlist[index]);

Loading…
Cancel
Save