From: Perttu Ahola Date: Mon, 26 Mar 2012 21:06:26 +0000 (+0300) Subject: Do a dumb-ass static string copy for const-incorrect old versions of ov_fopen X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=cbe11fc7aa77043b5b9485b01c78f2e5a5e35d9a;p=zefram%2Fminetest%2Fminetest_engine.git Do a dumb-ass static string copy for const-incorrect old versions of ov_fopen --- diff --git a/src/sound_openal.cpp b/src/sound_openal.cpp index e635e0fa..8d76b69e 100644 --- a/src/sound_openal.cpp +++ b/src/sound_openal.cpp @@ -116,9 +116,14 @@ SoundBuffer* loadOggFile(const std::string &filepath) char array[BUFFER_SIZE]; // Local fixed size array vorbis_info *pInfo; OggVorbis_File oggFile; - + + // Do a dumb-ass static string copy for old versions of ov_fopen + // because they expect a non-const char* + char nonconst[10000]; + snprintf(nonconst, 10000, "%s", filepath.c_str()); // Try opening the given file - if(ov_fopen(filepath.c_str(), &oggFile) != 0) + //if(ov_fopen(filepath.c_str(), &oggFile) != 0) + if(ov_fopen(nonconst, &oggFile) != 0) { infostream<<"Audio: Error opening "<