string.Trim doesn't remove NUL

I'm also skeptical of the `if (bs93/*=br.ReadBytes(6)*/ == "BS93") { ... }` just
after this, it doesn't seem the condition can ever be met...
This commit is contained in:
YoshiRulz 2021-01-06 16:50:49 +10:00
parent c1a734a04d
commit 966b8a974a
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,7 @@
using System.Text;
using System.IO;
using BizHawk.Common.StringExtensions;
using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Atari.Lynx
@ -32,8 +33,8 @@ namespace BizHawk.Emulation.Cores.Atari.Lynx
int p0 = br.ReadUInt16();
int p1 = br.ReadUInt16();
int ver = br.ReadUInt16();
string cname = Encoding.ASCII.GetString(br.ReadBytes(32)).Trim();
string mname = Encoding.ASCII.GetString(br.ReadBytes(16)).Trim();
string cname = Encoding.ASCII.GetString(br.ReadBytes(32)).SubstringBefore('\0').Trim();
string mname = Encoding.ASCII.GetString(br.ReadBytes(16)).SubstringBefore('\0').Trim();
int rot = br.ReadByte();
ms.Position = 6;