From 31242e9940af4dca9b6b98dc8fe29c8700a3a793 Mon Sep 17 00:00:00 2001 From: nkorslund Date: Fri, 11 Jul 2008 12:17:56 +0000 Subject: [PATCH] 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 --- sound/music.d | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/music.d b/sound/music.d index 0f7516e9f..86eee9cdd 100644 --- a/sound/music.d +++ b/sound/music.d @@ -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]);