Count the string length in the system codepage.

This commit is contained in:
Matthias Mailänder
2016-05-20 21:19:09 +02:00
parent 1df5e556c6
commit f22bc68d94

View File

@@ -13,6 +13,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using OpenAL;
namespace OpenRA.Platforms.Default
@@ -65,7 +66,7 @@ namespace OpenRA.Platforms.Default
do
{
var str = Marshal.PtrToStringAuto(next);
next += str.Length + 1;
next += UnicodeEncoding.Default.GetByteCount(str) + 1;
devices.Add(str);
} while (Marshal.ReadByte(next) != 0);