CStr: VC2005 fix - mustn't dereference end()

snd: Only open device once

This was SVN commit r2452.
This commit is contained in:
Ykkrosh
2005-07-01 22:53:03 +00:00
parent 54bd7367e8
commit f3b5e08030
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -220,9 +220,10 @@ static int alc_init()
{
debug_assert(!"hit me");
}
#else
alc_dev = alcOpenDevice((ALubyte*)alc_dev_name);
#endif
alc_dev = alcOpenDevice((ALubyte*)alc_dev_name);
if(alc_dev)
{
alc_ctx = alcCreateContext(alc_dev, 0); // no attrlist needed
+1 -1
View File
@@ -94,7 +94,7 @@ CStrW CStr8::FromUTF8() const
CStrW result;
const unsigned char* source = (const unsigned char*)&*begin();
const unsigned char* sourceEnd = (const unsigned char*)&*end();
const unsigned char* sourceEnd = source + length();
while (source < sourceEnd)
{
wchar_t ch = 0;