Alc.GetString used incorrect offset (was already increased due to ++). Breakpoint used to verify correctness at byte-level.

This commit is contained in:
chrisbrandtner 2008-01-15 15:49:25 +00:00
parent 42581eaeea
commit b3ab36eb44

View file

@ -230,17 +230,12 @@ namespace OpenTK.OpenAL
if (b != 0)
sb.Append((char)b);
if (b == 0)
{
if (Marshal.ReadByte(t, offset + 1) == 0)
{
result.Add(sb.ToString());
break;
}
if (Marshal.ReadByte(t, offset) == 0) // offset already properly increased through ++
break; // 2x null
else
{
if (sb.Length > 0) result.Add(sb.ToString());
sb.Remove(0, sb.Length);
}
sb.Remove(0, sb.Length); // 1x null
}
} while (true);