forked from mirror/openmw-tes3mp
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
This commit is contained in:
parent
da94867474
commit
31242e9940
1 changed files with 3 additions and 4 deletions
|
@ -26,6 +26,8 @@ module sound.music;
|
||||||
import sound.audiere;
|
import sound.audiere;
|
||||||
import sound.audio;
|
import sound.audio;
|
||||||
|
|
||||||
|
import std.string;
|
||||||
|
|
||||||
import core.config;
|
import core.config;
|
||||||
import core.resource;
|
import core.resource;
|
||||||
|
|
||||||
|
@ -178,10 +180,7 @@ struct MusicManager
|
||||||
index = 0;
|
index = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the string is null terminated
|
music = cpp_playStream(toStringz(playlist[index]), volume);
|
||||||
assert(*(playlist[index].ptr+playlist[index].length) == 0);
|
|
||||||
|
|
||||||
music = cpp_playStream(playlist[index].ptr, volume);
|
|
||||||
|
|
||||||
if(!music) fail("Unable to start music track " ~ playlist[index]);
|
if(!music) fail("Unable to start music track " ~ playlist[index]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue