mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-28 11:33:06 +00:00
Parse address port as unsigned short
This commit is contained in:
parent
e263c70f09
commit
456b91307a
2 changed files with 2 additions and 1 deletions
|
@ -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() + "." +
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue