diff --git a/OpenRA.Game/FileFormats/XccGlobalDatabase.cs b/OpenRA.Game/FileFormats/XccGlobalDatabase.cs index abec7e0ceb..1b29c4678d 100644 --- a/OpenRA.Game/FileFormats/XccGlobalDatabase.cs +++ b/OpenRA.Game/FileFormats/XccGlobalDatabase.cs @@ -20,22 +20,21 @@ namespace OpenRA.FileFormats public XccGlobalDatabase(Stream s) { var entries = new List(); - var reader = new BinaryReader(s); - while (reader.PeekChar() > -1) + while (s.Peek() > -1) { - var count = reader.ReadInt32(); + var count = s.ReadInt32(); for (var i = 0; i < count; i++) { var chars = new List(); - char c; + byte c; // Read filename - while ((c = reader.ReadChar()) != 0) - chars.Add(c); + while ((c = s.ReadUInt8()) != 0) + chars.Add((char)c); entries.Add(new string(chars.ToArray())); // Skip comment - while ((c = reader.ReadChar()) != 0) { } + while ((c = s.ReadUInt8()) != 0) { } } }