From 456b91307a40dcf7201d1d6a635b922f01eded22 Mon Sep 17 00:00:00 2001 From: Sajid Anwar Date: Fri, 15 Jun 2018 10:22:04 -0700 Subject: [PATCH] Parse address port as unsigned short --- Ryujinx.HLE/OsHle/Services/Bsd/IClient.cs | 2 +- Ryujinx.HLE/OsHle/Utilities/EndianSwap.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Ryujinx.HLE/OsHle/Services/Bsd/IClient.cs b/Ryujinx.HLE/OsHle/Services/Bsd/IClient.cs index 439a54005..f007331b3 100644 --- a/Ryujinx.HLE/OsHle/Services/Bsd/IClient.cs +++ b/Ryujinx.HLE/OsHle/Services/Bsd/IClient.cs @@ -413,7 +413,7 @@ namespace Ryujinx.HLE.OsHle.Services.Bsd int Size = Reader.ReadByte(); int Family = Reader.ReadByte(); - int Port = EndianSwap.Swap16(Reader.ReadInt16()); + int Port = EndianSwap.Swap16(Reader.ReadUInt16()); string IpAddress = Reader.ReadByte().ToString() + "." + Reader.ReadByte().ToString() + "." + diff --git a/Ryujinx.HLE/OsHle/Utilities/EndianSwap.cs b/Ryujinx.HLE/OsHle/Utilities/EndianSwap.cs index 93fd38c8f..164c1cc77 100644 --- a/Ryujinx.HLE/OsHle/Utilities/EndianSwap.cs +++ b/Ryujinx.HLE/OsHle/Utilities/EndianSwap.cs @@ -3,5 +3,6 @@ static class EndianSwap { public static short Swap16(short Value) => (short)(((Value >> 8) & 0xff) | (Value << 8)); + public static ushort Swap16(ushort Value) => (ushort)(((Value >> 8) & 0xff) | (Value << 8)); } }